Example #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.layer == 9 && targets.Contains(other.gameObject))
     {
         boost us;
         us   = new boost();
         us.r = -uu.r;
         us.h = 0;
         us.t = 1 / uu.t;
         targets.Remove(other.gameObject);
         other.SendMessage("Kanapka", us);
     }
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        preh = hp;
        hymm = new Transform[3];
        nma  = this.GetComponent <NavMeshAgent>();
        GameObject[] temp = GameObject.FindGameObjectsWithTag("Player");
        for (int i = 0; i < 2; i++)
        {
            hymm[i] = temp[i].transform;
        }
        hymm[2] = GameObject.FindGameObjectWithTag("Statute").transform;
        Debug.Log("przed");
        target = hymm[2];
        Debug.Log("po" + hymm[2].name);

        this.gameObject.GetComponentInChildren <SphereCollider>().radius = range;
        uu   = new boost();
        uu.h = ph;
        uu.r = pr;
        uu.t = pt;
        hpp  = 0;
        rand = (int)Random.value * 5;
        switch (rand)
        {
        case 1:
            gates    = new GameObject[2];
            gates[0] = GameObject.Find("gate1");
            gates[1] = GameObject.Find("gate2");
            break;

        case 2:
            gates    = new GameObject[3];
            gates[0] = GameObject.Find("gate6");
            gates[1] = GameObject.Find("gate5");
            gates[2] = GameObject.Find("gate4");
            break;

        default:
            gates    = new GameObject[2];
            gates[0] = GameObject.Find("gate3");
            gates[1] = GameObject.Find("gate4");
            break;
        }
        target = gates[0].transform;
        StartCoroutine(findAndKill());
        StartCoroutine(shootAndKill());
    }
Example #3
0
    void UpdateBoost()
    {
        boostSystem = PlayerShip.GetPlayerBoosts();
        float barSize = 0f;
        int   i       = 0;

        foreach (Image boost in boosts)
        {
            switch (i)
            {
            case 0:
                barSize = boostSystem.bulletTime;
                break;

            case 1:
                barSize = boostSystem.reflex;
                break;

            case 2:
                barSize = boostSystem.speedBoost;
                break;

            case 3:
                barSize = boostSystem.energy;
                break;

            case 4:
                barSize = boostSystem.freezeTime;
                break;

            default:
                Debug.Log("HUDSystems:UpdateBoost - boost has not been set in good way!");
                break;
            }
            float Ay = boost.transform.GetComponent <RectTransform>().anchorMax.y;
            boost.transform.GetComponent <RectTransform>().anchorMax = new Vector2(barSize, Ay);
            i++;
        }
        // Debug.Log("HUDSystems:UpdateBoost - Boosts updating");
    }