1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Godot R3 追加

Posted at

環境

OS:Mac
Godot:Godot_mono(v4.2.1)
dotnet:v8.0.101

前提

プロジェクト名:R3woInstallShitaiProject

.
├── R3woInstallShitaiProject.csproj
├── R3woInstallShitaiProject.sln
├── icon.svg
├── icon.svg.import
├── main.cs
├── main.tscn
└── project.godot
  • main.csを追加してから実行ボタンを押している必要があるかも

R3を導入

■ ターミナルでR3woInstallShitaiProjectに移動

■ R3導入コマンドを実行

dotnet add R3woInstallShitaiProject.csproj package R3

R3woInstallShitaiProject.csprojがこうなる

<Project Sdk="Godot.NET.Sdk/4.2.1">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
    <EnableDynamicLoading>true</EnableDynamicLoading>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="R3" Version="0.1.19" />
  </ItemGroup>
</Project>

アドオンを導入する

https://github.com/Cysharp/R3/releases
Ver.0.1.19のSource code(zip)をダウンロードしてどこかに保存

解凍

R3-0.1.19/src/R3.Godotの中身をR3woInstallShitaiProject以下に配置する

.
├── R3woInstallShitaiProject.csproj
├── R3woInstallShitaiProject.sln
├── addons
│   ├── R3.Godot
│   │   ├── FrameProviderDispatcher.cs
│   │   ├── GodotFrameProvider.cs
│   │   ├── GodotProviderInitializer.cs
│   │   ├── GodotR3Plugin.cs
│   │   ├── GodotTimeProvider.cs
│   │   ├── GodotUINodeExtensions.cs
│   │   ├── ObservableTrackerDebuggerPlugin.cs
│   │   ├── ObservableTrackerRuntimeHook.cs
│   │   ├── ObservableTrackerTab.cs
│   │   ├── ObservableTrackerTree.cs
│   │   └── plugin.cfg
│   └── R3.Godot.csproj
├── icon.svg
├── icon.svg.import
├── main.cs
├── main.tscn
└── project.godot

アドオンを有効化する

プロジェクト > プロジェクト設定 > プラグイン 
R3.Godotのステータスを有効にする
*有効化に失敗した時は一度エディタを実行(ビルド)するとうまくいくかもしれない

導入終了

動作確認

■ main.csに書いて見る

using Godot;
using System;
using R3;
public partial class main : Node2D
{
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		Observable.EveryUpdate().Subscribe(_ => GD.Print("Ugoita!"));
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}
}

■ 実行
ログにUgoita!が出まくる、うれしいね

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?