void Awake() { pause = pauseButton.GetComponent <Pause>(); createPlatform = gameObject.GetComponent <CreatePlatform>(); left = Left.transform.rotation; right = Right.transform.rotation; towards = Towards.transform.rotation; animator = GetComponent <Animator>(); }
void Awake() { pause = pauseButton.GetComponent<Pause>(); createPlatform = gameObject.GetComponent<CreatePlatform>(); left = Left.transform.rotation; right = Right.transform.rotation; towards = Towards.transform.rotation; animator = GetComponent<Animator>(); }
public void Init() { engine = GetComponent <CharacterInputController>(); engine.refreshDitance = new CharacterInputController.RefreshDistance(RefreshDistance); ui_controller = GetComponent <CharacterUIController>(); controlGame = GameObject.Find("GameControl").GetComponent <ControlGame>(); startPos = transform.position; MapControl mapControl = GameObject.Find("MapControl").GetComponent <MapControl>(); createPlatform = mapControl.CreatePlatform; }
// Use this for initialization void Start() { instance = this; currentPos = transform.position; float step = Mathf.Sqrt(2) * 0.5f; stepRight = new Vector3(step, 0, step); stepLeft = new Vector3(step * (-1), 0, step); GlobalValue.levelPathLeft = GlobalValue.levelPlaying; listPath = new List <GameObject> (); randomPathLength = Random.Range(7, 11); //first path CreatePath(); //create first path on start }
private void Update() { if (freezePlayerState) { return; } currentState.Update(this); IfDebugActivateSlowMotion(); UpdateFacingSprite(); PositionWalkParticles(); if (!isDying) { CheckIfHasResetDashTrigger(); shield.CheckShieldInput(); CreatePlatform.CheckCreateInput(this); CreatePlatform.CheckDeleteInput(this); } }