// Use this for initialization void Start() { m_firstTimeFlipping = true; m_valkyrieCharacterController = GetComponent <CharacterController>(); m_gameController = GameController.Instance; m_playerIndex = transform.parent.GetComponent <PlayerData>().m_PlayerIndex; m_player = GetComponent <Rigidbody>(); m_boundaryHolder = GameController.Instance.boundaryHolder; m_bodySprite = transform.Find("body_sprite").GetComponent <SpriteRenderer>(); m_playerSize = m_bodySprite.bounds.size; //wing animator m_wingAnimatorNonFlipped = m_wingsNonFlipped.GetComponent <Animator>(); m_wingAnimatorFlipped = m_wingsFlipped.GetComponent <Animator>(); //assign the valkyries body animator controller based on player index m_bodyAnimator = transform.Find("body_sprite").GetComponent <Animator>(); m_bodyAnimator.runtimeAnimatorController = Resources.Load("Valkyrie_P" + m_playerIndex.ToString()) as RuntimeAnimatorController; // Set Idle animation state isIdle = true; m_thisScale = transform.localScale.x; StartCoroutine("ContiniouslyEvaluateScore"); StartCoroutine("ContinouslySetBoundaries"); m_valkyrieCollisionSize = GetComponent <BoxCollider>().bounds.extents; }
//public Collider m_meshCollider; // Use this for initialization void Awake() { m_rigidBody = GetComponent <Rigidbody>(); m_collider = GetComponent <Collider>(); EnableRagdoll(); m_gameController = GameController.Instance; m_platformLayer = LayerMask.GetMask("Platform"); m_scoreManager = m_gameController.m_scoreManager; m_boundaryHolder = GameController.Instance.boundaryHolder; m_projectileSize = GetComponent <SpriteRenderer>().bounds.extents; StartCoroutine(LateAwake()); StartCoroutine("ContinouslySetBoundaries"); }
void Start() { m_currentHealth = m_startHealth; m_hpBelowHalf.SetActive(false); m_hpThreeHitLeft.SetActive(false); m_BallSprite_Full.SetActive(true); m_BallSprite_Half.SetActive(false); m_BallSprite_ThreeLeft.SetActive(false); //Calculation for making the ball stay within camera view. m_boundaryHolder = GameController.Instance.boundaryHolder; m_ballSize = transform.Find("BallHP_Full").GetComponent <SpriteRenderer>().bounds.extents; //;GetComponent<BouncingBall>().GetComponent<SpriteRenderer>().bounds.extents; m_axeDamage = 10; //(GetComponent<ProjectileBehaviour>().m_projectileDamage); Vector3 m_currentVelocity = rb.velocity; //rb.AddForce(m_XBounceSpeed, m_YBounceSpeed, 0 * Time.deltaTime); //StartCoroutine(Pause()); }
// Use this for initialization void Start() { m_vikingcCharacterController = GetComponent <CharacterController>(); m_playerData = GetComponentInParent <PlayerData>(); m_gameController = GameController.Instance; if (m_playerData != null) { m_thisPlayerIndex = m_playerData.m_PlayerIndex; } m_playerIndexString = m_thisPlayerIndex.ToString(); m_rb = GetComponent <Rigidbody>(); m_isGroundedTimer = m_isGroundedOffset; m_goThroughPlatformsTimer = m_isThroughPlatformOffset; m_playersLayer = 10; m_goThroughPlatformLayer = 11; m_turnedLeft = true; m_playerSize = GetComponent <SpriteRenderer>().bounds.extents; m_boundaryHolder = GameController.Instance.boundaryHolder; m_vikingRespawn = GetComponent <VikingRespawn>(); m_detectPickup = GetComponent <DetectPickup>(); m_thisScale = transform.localScale.x; //assign an animator controller based on player index m_animator = transform.gameObject.GetComponent <Animator>(); m_animator.runtimeAnimatorController = Resources.Load("Viking_P" + m_playerIndexString) as RuntimeAnimatorController; // Set Idle animation state m_isIdle = true; StartCoroutine("ContiniouslyEvaluateScore"); StartCoroutine("ContinouslySetBoundaries"); }