示例#1
0
文件: Sword.cs 项目: fabiusBile/yaia
 // Use this for initialization
 void Start()
 {
     transform.root.GetComponent <Animator> ().SetBool("Sword", true);
     pc = transform.root.GetComponent <PlayerControl> ();
     weaponController = transform.parent.GetComponent <weapon_controller> ();
     anm         = transform.root.GetComponent <Animator> ();
     swordEnd    = transform.GetChild(0);
     swordHandle = transform.parent;
     swordLength = Vector2.Distance(swordHandle.position, swordEnd.position);
 }
示例#2
0
    // Update is called once per frame
    void Start()
    {
        Transform body = transform.root.GetChild(1);

        handsL      = body.FindChild("HandL");
        handsR      = body.FindChild("HandR");
        lHandle     = transform.FindChild("LHandle");
        pc          = transform.root.GetComponent <PlayerControl> ();
        facingRight = true;
        transform.root.GetComponent <Animator> ().SetBool("Mgun", true);
        weaponController = transform.parent.GetComponent <weapon_controller> ();
    }