void Awake() { m_TileGrid = FindObjectOfType <TileGrid>(); m_CameraController = FindObjectOfType <CameraController>(); m_Transform = GetComponent <Transform>(); m_Rigidbody2D = GetComponent <Rigidbody2D>(); m_EyesController = GetComponent <EyesController>(); m_CheckpointPosition = transform.position; if (m_FacingLeft) { FaceLeft(); } m_Grounded = m_StartGrounded; m_LandingSquashSequence = ActionMaster.Actions.Sequence(); m_FrontSquashSequence = ActionMaster.Actions.Sequence(); m_BackSquashSequence = ActionMaster.Actions.Sequence(); m_DeathSequence = ActionMaster.Actions.Sequence(); m_HopSequence = ActionMaster.Actions.Sequence(); m_HopDefaultY = m_HopNode.localPosition.y; m_PreviousX = transform.position.x; m_DefaultGravity = m_Rigidbody2D.gravityScale; m_DefaultColor = m_BodySpriteRenderer.color; GlobalData.PlayModePreToggle += OnPlayModePreToggle; }
void Awake() { m_Transform = transform; m_HopController = GetComponent <HopController>(); m_EyesController = GetComponent <EyesController>(); GlobalData.GhostModeEnabled += OnGhostModeEnabled; GlobalData.GhostModeDisabled += OnGhostModeDisabled; m_Ghosts = new Ghost[m_MaxGhosts]; m_ActivationDistanceSq = m_ActivationDistance * m_ActivationDistance; }
private void Awake() { m_Transform = transform; m_EyesController = GetComponent <EyesController>(); m_EyesController.enabled = false; m_TargetLookAngle = 90 + m_NumberOfTurns * 360; var goalFX = GameObject.FindGameObjectsWithTag("GoalFX"); foreach (var fx in goalFX) { m_FireworksSystems.Add(fx.GetComponent <ParticleSystem>()); } }
public void Setup(List <SquashController> squashControllers, HopController hopController, EyesController eyesController) { for (var i = 0; i < m_SquashNodes.Count; ++i) { m_SquashNodes[i].localScale = squashControllers[i].m_SquashNode.localScale; } m_HopNode.localPosition = hopController.m_HopNode.localPosition; m_EyesRoot.localPosition = eyesController.m_EyesRoot.localPosition; m_LeftBlinkRoot.localScale = eyesController.m_LeftBlinkRoot.localScale; m_RightBlinkRoot.localScale = eyesController.m_RightBlinkRoot.localScale; m_LeftRotateRoot.localPosition = eyesController.m_LeftRotateRoot.localPosition; m_RightRotateRoot.localPosition = eyesController.m_RightRotateRoot.localPosition; }
private void Awake() { instance = this; player1Camera = GameObject.Find("Player 1 Camera UI").GetComponent <Camera>(); player2Camera = GameObject.Find("Player 2 Camera UI").GetComponent <Camera>(); }
public ActionTurnFacing(GameObject go, float end, float duration, Ease ease = null) : base(go, end, duration, ease) { Name = "TurnFacing"; Eyes = go?.GetComponent <EyesController>(); }
private void Awake() { m_Transform = transform; m_EyesController = GetComponent <EyesController>(); }