public TouchControlInputs(TouchInputs TouchInputs) { this.TouchInputs = TouchInputs; Dpad = new DpadDirectionTouchDectector( TouchControllerRenderer.BUTTON_TOP_X , TouchControllerRenderer.BUTTON_TOP_Y , TouchControllerRenderer.BUTTON_BOT_X , TouchControllerRenderer.BUTTON_BOT_Y , TouchControllerRenderer.BUTTON_LEFT_X , TouchControllerRenderer.BUTTON_LEFT_Y , TouchControllerRenderer.BUTTON_RIGHT_X , TouchControllerRenderer.BUTTON_RIGHT_Y , DpadDirection.Up , DpadDirection.Down , DpadDirection.Left , DpadDirection.Right ); Actions = new DpadDirectionTouchDectector( TouchControllerRenderer.BUTTON2_TOP_X , TouchControllerRenderer.BUTTON2_TOP_Y , TouchControllerRenderer.BUTTON2_BOT_X , TouchControllerRenderer.BUTTON2_BOT_Y , TouchControllerRenderer.BUTTON2_LEFT_X , TouchControllerRenderer.BUTTON2_LEFT_Y , TouchControllerRenderer.BUTTON2_RIGHT_X , TouchControllerRenderer.BUTTON2_RIGHT_Y , DpadAction.Special , DpadAction.Jump , DpadAction.Attack , DpadAction.Defense ); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } uIManager = GetComponent <UIManager>(); environmentGenerator = GetComponent <EnvironmentGenerator>(); bugSpawner = GetComponent <BugSpawner>(); touchInputs = GetComponent <TouchInputs>(); #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL pauseButton.transform.SetParent(uIPanel.transform); Destroy(touchInputObject); #endif #if UNITY_IOS || UNITY_ANDROID Destroy(instructions); #endif }
//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; }