Example #1
0
    void Update()
    {
        if (Level.gameRunning && !Tutorial.beamLock)
        {
            beamOn = false;
            if (Input.GetMouseButton(0) && !isOnCooldown)
            {
                beamOn = true;

                if (Input.GetMouseButtonDown(1) && tractoredObject != null && !Tutorial.fireLock)
                {
                    if (Tutorial.fireCheck)
                    {
                        Tutorial.AdvanceTutorial();
                    }

                    tractoredObject.GetComponent <Junk>().SetMaterial(null).Fire().rigidbody.velocity += ((tractoredObject.transform.position - transform.position).normalized * pushForce);
                    tractoredObject = null;
                    beamOn          = false;
                    StartCoroutine(Cooldown());
                }
            }
            else if (tractoredObject != null)
            {
                tractoredObject.GetComponent <Junk>().SetMaterial(null).StopTractor();
                tractoredObject = null;
            }

            if (Input.GetMouseButtonUp(0) && Tutorial.checkBeam)
            {
                Tutorial.AdvanceTutorial();
            }
        }
    }
Example #2
0
 void OnTriggerEnter(Collider c)
 {
     if (c.CompareTag("Goal") && Goal.activationType == Goal.ActivationType.Player)
     {
         SlowDown();
         Tutorial.AdvanceTutorial();
     }
 }
Example #3
0
    public void OnPointerDown(PointerEventData data)
    {
        Debug.Log("Clicked");
        Tutorial tutorial = GameObject.FindGameObjectWithTag("tutorial").GetComponent <Tutorial>();

        if (left)
        {
            tutorial.RetreatTutorial();
        }
        else
        {
            tutorial.AdvanceTutorial();
        }
    }
Example #4
0
 void OnTriggerEnter(Collider c)
 {
     if (c.CompareTag("JunkDestroyer"))
     {
         Destroy(gameObject);
     }
     else if (c.CompareTag("ISS") && !isTractored && !hasHit)
     {
         hasHit = true;
         ISS.Hit((int)Mathf.Floor(rigidbody.mass * 10), gameObject);
         Destroy(gameObject);
     }
     else if (c.CompareTag("Goal"))
     {
         if (Goal.activationType == Goal.ActivationType.Junk || (Goal.activationType == Goal.ActivationType.Fired && wasFired))
         {
             Tutorial.AdvanceTutorial();
             Destroy(gameObject);
         }
     }
 }