コード例 #1
0
ファイル: DeathStar.cs プロジェクト: bigstupidx/Zap
        void Start()
        {
            m_SpeedMultiplier = 1.0f;
            m_IsMoving        = true;
            m_PlayerMovement  = GameMaster.Instance.m_PlayerMovement;
            m_PlayerStats     = GameMaster.Instance.m_PlayerStats;
            CircleCollider2D playerCircleCollider = m_PlayerMovement.GetComponent <CircleCollider2D>();

            if (playerCircleCollider != null)
            {
                m_PlayerColliderRadius = playerCircleCollider.radius;
            }

            // Cap base speed
            if (m_BaseSpeed > m_MaxSpeed)
            {
                m_BaseSpeed = m_MaxSpeed;
            }
        }
コード例 #2
0
 public void ForceSwitchToMC()
 {
     if (mc.isActiveAndEnabled)
     {
         obtainedNPC = false;
     }
     else
     {
         obtainedNPC   = false;
         mc.enabled    = true;
         mcIsFollowing = false;
         npc.enabled   = false;
         currentPlayer = mc.transform;
         npc.GetComponent <PlayerMovement>().StopAnimation();
         // npc.GetComponent<CharacterController2D>().QueueDisableColliders();
         mc.GetComponent <CharacterController2D>().EnableColliders();
         playerMentalHealth.SwitchTarget(mc.gameObject);
         mainCamera.switchTarget(mc);
     }
 }
コード例 #3
0
ファイル: PlayerAnim.cs プロジェクト: leamzi/wj2018
 // Use this for initialization
 void Start()
 {
     playerObj  = FindObjectOfType <PlayerMovement>();
     playerAnim = playerObj.GetComponent <Animator>();
 }