Пример #1
0
    public void Launch()
    {
        RocketTrail.SetActive(true);
        startPos  = this.transform.position;
        endPos    = this.transform.position + new Vector3(0, 70f, 0);
        startTime = Time.time;
        len       = Vector3.Distance(startPos, endPos);

        activate = true;
        this.transform.parent = null;
        float maxDistance = 1000000;

        foreach (GameObject o in PlayerManager.ins.playersInScene)
        {
            if (o.name != whoFired.name)
            {
                float d = Vector3.Distance(this.transform.position, o.transform.position);
                if (d < maxDistance)
                {
                    maxDistance = d;
                    target      = o;
                }
            }
        }
    }
Пример #2
0
    private void Awake()
    {
        rb                           = GetComponent <Rigidbody>();
        rocketTrail                  = GetComponent <RocketTrail>();
        slowMotionController         = GetComponent <SlowMotionController>();
        progressManager              = FindObjectOfType <ProgressManager>();
        GameManager.ChangeModeEvent += ChangeMode;

        rocketT = GetComponent <Transform>();
        playerT = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();

        //Выстраивание рокеты в мировом пространстве
        rocketSpawner = RocketSpawner.Instatnce;
    }
Пример #3
0
 // Use this for initialization
 void Awake()
 {
     rocketTrail = transform.Find("RocketTrail").GetComponent<RocketTrail>();
     currentFuel = totalFuel;
     targetTilt = 0;
 }