Пример #1
0
    //-------------------
    // AWAKE
    //-------------------
    void Awake()
    {
        pointsValue = 1500;

        armour = 5; // subtracted from any hit damage values this enemy may receive



        bulletXY    = new Vector3[4]; //for 4 BARRELS:  offsets on the end of the turret Gun: 2x2 grid
        bulletXY[0] = new Vector3(0, 0, 0);
        bulletXY[1] = new Vector3(0, 0, 0);
        bulletXY[2] = new Vector3(0, 0, 0);
        bulletXY[3] = new Vector3(0, 0, 0);


        turretZOffset = 0f; // Makes Missile appear on end of 'barrel' Z and not from its pivot point



        state = mode.passive;

        attackRadius = 350;
        blindRadius  = 100; // Switches off the targeting if too close

        GameObject tempObject = GameObject.Find("GunView");

        target = tempObject.transform;

        tempObject   = GameObject.Find("PlayerCamera");
        playerCamera = tempObject.GetComponent <Camera>();    //
        sfx          = tempObject.GetComponent <FXManager>(); //

        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject         = GameObject.Find("A_Scene_Manager");
        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary

        // NGUI LABELS POOL
        tempObject   = GameObject.Find("A_Null_Labels");
        pointsScript = tempObject.GetComponent <ScriptPointsManager>();


        // Get Turret hinge
        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "turntable")
            {
                hinge = c;
            }
        }
        // Get turret
        //for (int i = 0; i < hinge.transform.childCount; i++) { Transform c = hinge.transform.GetChild(i); if (c.name == "gun") { turret = c; } }
    }
Пример #2
0
    //-------------------
    // AWAKE
    //-------------------
    void Awake()
    {
        pointsValue = 850;

        armour = 15; // subtracted from any hit damage values this enemy may receive


        state = mode.passive;

        attackRadius = 260;

        blindRadius = 70; // Switches off the targeting if too close

        GameObject tempObject = GameObject.Find("GunView");

        target = tempObject.transform;

        tempObject   = GameObject.Find("PlayerCamera");
        playerCamera = tempObject.GetComponent <Camera>();    //
        sfx          = tempObject.GetComponent <FXManager>(); //

        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject         = GameObject.Find("A_Scene_Manager");
        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary

        // NGUI LABELS POOL
        tempObject   = GameObject.Find("A_Null_Labels");
        pointsScript = tempObject.GetComponent <ScriptPointsManager>();


        // Get Turret hinge
        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "turret")
            {
                hinge = c;
            }
        }
        if (hinge)
        {
            for (int i = 0; i < hinge.transform.childCount; i++)
            {
                Transform c = hinge.transform.GetChild(i); if (c.name == "gun")
                {
                    turret = c;
                }
            }
        }
    }
Пример #3
0
    //-------------------
    // AWAKE
    //-------------------
    void Awake()
    {
        pointsValue = 15000;

        armour = 45; // subtracted from any hit damage values this enemy may receive


        state = mode.passive;

        attackRadius = 260;

        GameObject tempObject = GameObject.Find("GunView");

        target = tempObject.transform;

        tempObject   = GameObject.Find("PlayerCamera");
        playerCamera = tempObject.GetComponent <Camera>();    //
        sfx          = tempObject.GetComponent <FXManager>(); //

        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject         = GameObject.Find("A_Scene_Manager");
        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary

        // NGUI LABELS POOL
        tempObject   = GameObject.Find("A_Null_Labels");
        pointsScript = tempObject.GetComponent <ScriptPointsManager>();

        Transform temp = null;

        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "comms")
            {
                temp = c;
            }
        }
        // Get turret
        for (int i = 0; i < temp.transform.childCount; i++)
        {
            Transform c = temp.transform.GetChild(i); if (c.name == "hinge")
            {
                hinge = c;
            }
        }
    }
Пример #4
0
    //-------------------
    // PREFAB FINDER
    //-------------------


    void Get_Prefab_Pointers()
    {
        GameObject tempObject = GameObject.Find("A_Scene_Manager");

        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary


        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject = GameObject.Find("PlayerCamera");
        Camera playerCamera = tempObject.GetComponent <Camera>(); //

        sfx = tempObject.GetComponent <FXManager>();              // Sound and particles

        // NGUI LABELS POOL
        tempObject   = GameObject.Find("A_Null_Labels");
        pointsScript = tempObject.GetComponent <ScriptPointsManager>();

        //pre = tempObject.GetComponent<ScriptASceneManager>();

        //for (int i = 0; i < pre.objectPoolList.Length; i++)
        //{
        // Assign Default projectile for this enemy to Shoot
        //if (pre.objectPoolList[i].name == "bulletTracer") { projectile = pre.objectPoolList[i]; }
        // Basic Thrust Particle Effect to be added to the missile so find a reference in the object pool and assign it
        //if (pre.objectPoolList[i].name == "P_fx_thrust01") { fx = pre.objectPoolList[i]; }
        //}


        //-------------------
        // Find Spawn positions for bullet sparks on Player's helicopter
        gunView = GameObject.Find("innerA").transform; // for 'Quickly' lining up bullets with end of barrel - Use as Muzzle flash too

        i = 0;
        for (i = 0; i < gunView.transform.childCount; i++)
        {
            Transform c  = gunView.transform.GetChild(i);
            string    st = c.name;
            //if (st.Contains("spp")) { Destroy(c.renderer); Mesh mesh = c.GetComponent<MeshFilter>().mesh; DestroyImmediate(mesh); Debug.Log("found!"); }
            if (st.Contains("spp"))
            {
                sparkList.Add(c);
            }
        }
    }
Пример #5
0
    //---------------------
    void Awake()
    {
        playerCamera = GameObject.Find("PlayerCamera");


        NGUICamera = GameObject.Find("Camera");

        GameObject tempObject = GameObject.Find("UI Root (2D)");

        uirootScript = tempObject.GetComponent <UIRoot>(); //

        UI = GetComponent <UILabel>();

        tempObject          = GameObject.Find("A_Null_Labels");
        pointsManagerScript = tempObject.GetComponent <ScriptPointsManager>(); //



        yOffset = 12f;

        alphaStep = 0.33f;
    }
Пример #6
0
    //-------------------
    // AWAKE
    //-------------------
    void Awake()
    {
        pointsValue = 850;

        armour = 15; // subtracted from any hit damage values this enemy may receive


        state = mode.passive;

        attackRadius = 260;

        GameObject tempObject = GameObject.Find("GunView");

        target = tempObject.transform;

        tempObject   = GameObject.Find("PlayerCamera");
        playerCamera = tempObject.GetComponent <Camera>();    //
        sfx          = tempObject.GetComponent <FXManager>(); //

        //Find and get INPUT MANAGER SCRIPT - Totally necessary :)
        tempObject = GameObject.Find("A_GameWrapper");
        inp        = tempObject.GetComponent <ScriptAInputManager>(); //

        tempObject         = GameObject.Find("A_Scene_Manager");
        sceneManagerScript = tempObject.GetComponent <ScriptASceneManager>(); // Access to 'LEVEL DATA[]'  file necessary

        // NGUI LABELS POOL
        tempObject   = GameObject.Find("A_Null_Labels");
        pointsScript = tempObject.GetComponent <ScriptPointsManager>();


        // Get Turret hinge

        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "BladesFrontSpinning")
            {
                c.renderer.enabled = false;
            }
        }
        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "BladesBackSpinning")
            {
                c.renderer.enabled = false;
            }
        }

        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "BladesFrontStill")
            {
                fRotor = c;
            }
        }
        for (int i = 0; i < transform.childCount; i++)
        {
            Transform c = transform.GetChild(i); if (c.name == "BladesBackStill")
            {
                bRotor = c;
            }
        }
    }