Example #1
0
        private void AssignParts()
        {
            weaponStand = GetComponent <WeaponStand> ();
            Transform prefab = transform.GetChild(0);

            for (int i = 0; i < prefab.childCount; i++)
            {
                if (prefab.GetChild(i).name == "AxeStand")
                {
                    weaponStand.stand = prefab.GetChild(i).transform;
                }
                else if (prefab.GetChild(i).name == "AudioSource")
                {
                    myAudio = prefab.GetChild(i).GetComponent <AudioSource> ();
                }
            }
            for (int i = 0; i < weaponStand.stand.childCount; i++)
            {
                if (weaponStand.stand.GetChild(i).name == "AxeHandle")
                {
                    axeHandle = weaponStand.stand.GetChild(i).transform;
                    break;
                }
            }
            InspectorUpdate();
        }
Example #2
0
        private void AssignParts()
        {
            weaponStand = GetComponent <WeaponStand> ();
            Transform prefab = transform.GetChild(0);

            for (int i = 0; i < prefab.childCount; i++)
            {
                if (prefab.GetChild(i).name == "Shooter_Stand")
                {
                    weaponStand.stand = prefab.GetChild(i).transform;
                    break;
                }
            }
            for (int i = 0; i < weaponStand.stand.childCount; i++)
            {
                if (weaponStand.stand.GetChild(i).name == "Shooter_Barrel")
                {
                    barrel = weaponStand.stand.GetChild(i).transform;
                    break;
                }
            }
            InspectorUpdate();
        }
Example #3
0
 public void OnEnable()
 {
     weaponStand = (WeaponStand)target;
 }