Example #1
0
    void Start()
    {
        //we know in this case the prefab is just 1 GameObject
        loadedAmmo  = ((GameObject)shootablePrefab).GetComponentsInChildren <Shootable> (true) [0];
        ammoStorage = AmmoStorage.Instance;         //singleton
        Transform baseAmmoTransform = loadedAmmo.GetComponentsInChildren <Transform> (true) [0];

        baseAmmoRotation = baseAmmoTransform.rotation;
        triggerPulled    = false;
        timeSinceShot    = 0F;
    }