// Start is called before the first frame update void Start() { if (Profile == null) { InGameDebug.Log(GetType().Name + ": Profile was not set."); } _profileNameText.text = Profile.Name; foreach (var axis in Profile.Axes) { Instantiate(_inputAxisDisplay, transform).GetComponent <BBInputAxisDisplay>().Axis = axis; } Canvas.ForceUpdateCanvases(); }
public static void AddOnAxisPressed(string axisName, Action action, int priority = 0) { foreach (var profile in Profiles) { foreach (var axis in profile.Axes) { if (axis.Name == axisName) { axis.AddOnPressed(action, priority); return; } } } InGameDebug.Log("No axis with name '" + axisName + "'."); }
/// <summary> /// Adds an action to be called when an axis is released. /// </summary> /// <param name="axisName">Te name of the axis.</param> /// <param name="action">The action to perform.</param> /// <param name="priority">The priority of the action.</param> public static void AddOnAxisReleased(string axisName, DynValue action, int priority = 0) { foreach (var profile in Profiles) { foreach (var axis in profile.Axes) { if (axis.Name == axisName) { axis.AddOnReleased(() => LuaManager.Call(action), priority); return; } } } InGameDebug.Log("No axis with name '" + axisName + "'."); }
// Start is called before the first frame update void Start() { if (Axis == null) { InGameDebug.Log(GetType().Name + ": Axis was not set."); } _axisNameText.text = Axis.Name; foreach (var binding in Axis.PositiveKeyCodes) { var bindingDisplay = Instantiate(_bindingsDisplayPrefab, transform).GetComponent <BBInputBindingDisplay>(); bindingDisplay.Binding = binding; bindingDisplay.Axis = Axis; } Canvas.ForceUpdateCanvases(); }
void Awake() { names = new List <string>(); GC = GetComponent <InGameDebug>(); canvasGO = (GameObject)Instantiate(Resources.Load("UI/TestingCanvas")); dragGO = canvasGO.transform.Find("Image").gameObject; debugTextGO = dragGO.transform.Find("Dropdown").gameObject; debugText = debugTextGO.GetComponent <Dropdown>(); //rect = debugTextGO.GetComponent<RectTransform>(); //rect.anchoredPosition3D = new Vector3(0, 250, 0); if (!debuging) { canvasGO.SetActive(false); } AddDrag(); }
//level 3 //level 4 void Start() { levelComplete = false; nextLevelButton = GameObject.Find("NextLevelButton").GetComponent <Button>(); lastLevelButton = GameObject.Find("LastLevelButton").GetComponent <Button>(); levelSettings = LevelSettings.GC; debug = InGameDebug.GC; touch = TouchInputs.GC; if (GameData.levelsComplete < levelSettings.GetCurrentLevel() + 1) { //hints for levels while not complete switch (levelSettings.GetCurrentLevel()) { case 0: Hint.text = Hint.GC.RandomHint(); break; case 1: Hint.text = "Press and hold on Spheres to lift."; break; case 2: Hint.text = "Move another finger left and right while the object is selected to rotate."; glow = GameObject.Find("glow"); break; case 3: Hint.text = "Perhaps a bit more brain-muscles are needed?"; break; case 4: Hint.text = "Sometimes you have to reflect to move forward."; break; } Hint.GC.ShowHint(5); } else { //hints for levels while complete switch (levelSettings.GetCurrentLevel()) { case 0: Hint.text = Hint.GC.RandomHint(); Hint.GC.ShowHint(5); break; case 1: Hint.text = "Wonder what this powers.."; break; case 2: Hint.text = "Move another finger left and right while the object is selected to rotate."; glow = GameObject.Find("glow"); break; case 3: Hint.text = "Perhaps a bit more brain-muscles are needed?"; break; case 4: Hint.text = "Sometimes you have to reflect to move forward."; break; } } }
void Start() { GC = GetComponent <TouchInputs>(); debug = InGameDebug.GC; touches = new Touch[10]; }
/* NOTES * target is the object you selected * the ObjectCollision helps to detect the direction of the collisions * strength is how fast you can move the object. * need to set up boxSettings * speedReduction and speedIncrease should be inputed as positive */ void Start() { basicCollision = new BasicCollision(); touch = TouchInputs.GC; debug = InGameDebug.GC; }
private void LogTick(int tick) { InGameDebug.Log("Tick test: Tick = " + tick); }