// 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; }
// 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>(); }
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); } }
public override void Start() { base.Start(); muscle = FindObjectOfType <MusclesBehavior>(); shootyPoint = transform.Find("shootyPoint"); }