Пример #1
0
        void Start()
        {
            myRig            = GetComponent <Rigidbody>();
            myMovement       = GetComponent <MovementComponetBase>();
            weaponCreate     = GetComponent <WeaponCreate>();
            testPlayerCreate = FindObjectOfType <TestPlayerCreate>();

            testPlayerCreate.OnPlayerCreate = (myHandArray) =>
            {
                myHand = myHandArray;

                // イベントをバインド
                myHand[0].grabWeapon     += SetDominant;
                myHand[1].grabWeapon     += SetDominant;
                myHand[0].oppositeWeapon += SetOpposite;
                myHand[1].oppositeWeapon += SetOpposite;

                Debug.Log("aaaa");
            };

            //// イベントをバインド
            //myHand[0].grabWeapon += SetDominant;
            //myHand[1].grabWeapon += SetDominant;
            //myHand[1].oppositeWeapon += SetOpposite;
            //myHand[1].oppositeWeapon += SetOpposite;
        }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     myRig        = GetComponent <Rigidbody>();
     myMovement   = GetComponent <MovementComponetBase>();
     weaponCreate = GetComponent <WeaponCreate>();
 }