void Awake() { this.controlWheel = GetComponent <ControlWheel> (); //Remember to call Init!!! This is to ensure the scripts execute in the correct order this.controlWheel.Init(); ControlWheelSegment printToConsoleSegment = new ControlWheelSegment( name: "Print To Console", action: //If this notation is strange to you, check out this link: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions () => { Debug.Log("Hello, world!"); }, //Loads the Sprite from the Resources folder icon: Resources.Load <Sprite>("DemoConsoleLogger/1"), preferredPosition: ControlWheelSegment.PreferredPosition.Bottom ); ControlWheelSegment incrementor = new ControlWheelSegment( name: "Print To Console", //You don't have to pass arrow functions, you can also pass references to functions action: this.Increment, //Loads the Sprite from the Resources folder icon: Resources.Load <Sprite>("DemoConsoleLogger/2"), preferredPosition: ControlWheelSegment.PreferredPosition.Top ); this.controlWheel.AddControlWheelActions(new ControlWheelSegment[] { printToConsoleSegment, incrementor }); this.controlWheel.DisplayControlWheel(); }
protected virtual void Awake() { controlWheel = GetComponent <ControlWheel> (); }