示例#1
0
    public void Transition()
    {
        // Transition to next pusher
        Pusher3 lastPusher = currentPusher;

        currentPusher = pushers[lastPusher.hill];
        inTransition  = false;
        Debug.Log("Transitioning from Hill " + lastPusher.hill + " pusher to Hill " + currentPusher.hill + " pusher");
        lastPusher.TransitionOut();
    }
示例#2
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Pusher"))
     {
         Pusher3 pusher = other.GetComponent <Pusher3>();
         if (pusher.hill != NextHill && pusher.IsPushing)
         {
             previousPusher = other.GetComponent <Pusher3>();
             Debug.Log("Transition DQ");
         }
     }
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        turnAccel   = Input.acceleration;
        acc         = 0f;
        lastPos     = transform.position;
        currentHill = 1;
        StartCoroutine("LookDirection");
        currentPusher = pushers[0];

        foreach (Pusher3 p in pushers)
        {
            if (p != null)
            {
                p.SetBuggy(this);
                p.SetPushbar(this.pushbar);
                if (p.hill > 1)
                {
                    p.IsPushing = false;
                }
            }
        }
        heatDuration = 0;
    }
示例#4
0
    // =============================================================================================SPAWNING SET 7================================================================
    //---------------------------------------------------------------------------------------MECHANISM WORK GAP = 1.6 sec --------------------------------------------------------
    //------------------------------------------------------------------------------------NUMBER OF ROCKETS = 8-------------------------------------------------------------------

    void spawnrock7()
    {
        //SET1---------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 248)
        {
            Pusher1.SetActive(true);
            pusher1.instance.forcemove = true;
        }
        if (_time2 == 249)
        {
            Pusher3.SetActive(true);
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 252)
        {
            Pusher1.SetActive(false);
        }
        if (_time2 == 253)
        {
            Pusher3.SetActive(false);
        }
        //SET 2-----------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 >= 254 && _time2 < 260)
        {
            if (_time2 == 255 || _time2 == 258)
            {
                Instantiate(roundaboutrocket, new Vector3(transform.position.x, Random.Range(y1, y2), 0), Quaternion.identity);
            }
            else
            {
                Instantiate(rocket, new Vector3(transform.position.x, Random.Range(y1, y3), 0), Quaternion.identity);         //8
            }
        }
        //SET 3------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 261)
        {
            Pusher1.SetActive(true);
            pusher.instance.forcemove = true;
        }
        if (_time2 == 262)
        {
            Pusher3.SetActive(true);
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 263)
        {
            Pusher2.SetActive(true);
            pusher1.instance.forcemove = true;
        }
        if (_time2 == 264)
        {
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 265)
        {
            pusher.instance.forcemove = true;
            Pusher2.SetActive(false);
        }
        //SET 4----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        if (_time2 == 267)
        {
            plat.SetActive(true);
            platform.instance.move = true;
        }
        if (_time2 == 269)
        {
            pusher.instance.forcemove  = true;
            pusher2.instance.forcemove = true;
        }
        if (_time2 == 272)
        {
            platform.instance.move = false;
        }
        if (_time2 == 274)
        {
            plat.SetActive(false);
            Pusher1.SetActive(false);
            Pusher3.SetActive(false);
            CancelInvoke("spawnrock7");
            InvokeRepeating("spawnrock8", 1, 1.2f);
        }
        _time2++;
    }