Пример #1
0
    //  We use this to find all the shell spawners that are attached to
    //   this turret. If there is only one, it's a side turret. If there's
    //   two, that means that it is a front turret
    void Start()
    {
        Component[] shellSpawners;
        shellSpawners = GetComponentsInChildren <ShellSpawnerScript>();

        damage = 20.0f;

        foreach (ShellSpawnerScript ss in shellSpawners)
        {
            ssGOs.Add(ss.gameObject);
        }

        if (ssGOs.Count == 1)
        {
            firingFrequency = 0.5f;
        }
        else
        {
            firingFrequency = 1.0f;
        }
        //InvokeRepeating("fire", 0.0f, Random.Range(firingFrequency-0.1f, firingFrequency+0.1f));

        // Get the shell holder object
        GameObject shellHolder = GameObject.Find("ShellHolderObject");

        shellHolderScript = shellHolder.GetComponent <ShellHolderScript>();
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     //The Get "Debugs" script from Debug Loggers gameobject
     //debugGO = GameObject.FindWithTag("debug");
     debuggerScript   = GameObject.Find("DebugOptions").GetComponent <Debugs>();
     debugShellImpact = debuggerScript.debugShellImpact;
     //
     shellHolder       = GameObject.Find("ShellHolderObject");
     shellHolderScript = shellHolder.GetComponent <ShellHolderScript>();
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     shellHolderScript = GameObject.Find("ShellHolderObject").GetComponent <ShellHolderScript>();
     cs = GameObject.Find("Crate Spawner");
 }