示例#1
0
 void Start()
 {
     // my_rigidbody = this.GetComponent<Rigidbody2D>();
     m_CatAudio    = GetComponent <CatAudio>();
     m_RigidBody   = GetComponent <Rigidbody2D>();
     headTransform = transform.Find("Animation/bone_1/bone_2/bone_3/bone_4");
 }
示例#2
0
    void Start()
    {
        animator         = GetComponentInChildren <Animator>();
        m_foodCollector  = GetComponent <FoodCollector>();
        m_BoxCollider2D  = GetComponent <BoxCollider2D>();
        m_RigidBody      = GetComponent <Rigidbody2D>();
        m_SpriteRenderer = GetComponent <SpriteRenderer>();
        m_CatAudio       = GetComponent <CatAudio>();
        sr = GetComponentInChildren <SpriteRenderer>();
        stockController = GetComponent <StockController>();

        current_state = PlayerState.FALL;

        // TODO: In merge, replace variable in prefab, instead of doing this junk
        m_RigidBody.gravityScale = 2;

        //Check Cinemachine
        if (GameObject.Find("CM vcam1") != null)
        {
            vcam = GameObject.Find("CM vcam1").GetComponent <CinemachineVirtualCamera>();
        }

        if (GameObject.Find("TargetGroup1") != null)
        {
            vgroup = GameObject.Find("TargetGroup1").GetComponent <CinemachineTargetGroup>();
        }

        //StartCoroutine(DoDeath());
    }