Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        mb     = FindObjectOfType <MusclesBehavior>();
        gb     = FindObjectOfType <GunBehavior>();
        mjoint = GetComponent <SpringJoint2D>();
        gjoint = GetComponent <SpringJoint2D>();

        mjoint.connectedBody = mb.rb2;
        gjoint.connectedBody = gb.rb2;
    }
Esempio n. 2
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();

        gb = FindObjectOfType <GunBehavior>();
        mb = FindObjectOfType <MusclesBehavior>();

        leftFoot  = transform.Find("leftFloor").GetComponent <footScript>();
        rightFoot = transform.Find("rightFloor").GetComponent <footScript>();
    }
Esempio n. 3
0
    public void onDeath()
    {
        GunBehavior     ngb = GetComponent <GunBehavior>();
        MusclesBehavior nmb = GetComponent <MusclesBehavior>();

        audioManager.playClipHere("explode", transform.position);
        if (ngb == null && nmb == null)
        {
            Destroy(gameObject);
        }
        else if (nmb != null)
        {
            nmb.remoteDrop();
            nmb.transform.position = new Vector2(-100, -100); //just move him elsewhere...
        }
        else if (ngb != null)
        {
            string current = SceneManager.GetActiveScene().name;
            SceneManager.LoadScene(current);
        }
    }
Esempio n. 4
0
 public override void Start()
 {
     base.Start();
     muscle      = FindObjectOfType <MusclesBehavior>();
     shootyPoint = transform.Find("shootyPoint");
 }