Esempio n. 1
0
    public void Initialize()
    {
        if (jumper != null)
        {
            GameObject.Destroy(jumper.gameObject);
        }
        if (JumpCamera != null)
        {
            GameObject.Destroy(JumpCamera.gameObject);
        }

        jumper = Instantiate(jumperOrg, jumperOrg.transform.parent);
        jumper.gameObject.SetActive(true);

        JumpCamera = Instantiate(JumpCameraOrg, JumpCameraOrg.transform.parent);
        JumpCamera.gameObject.SetActive(true);

        jumperOrg.gameObject.SetActive(false);
        JumpCameraOrg.gameObject.SetActive(false);

        JumpCamera.GetComponent <SpringJoint>().connectedBody = jumper.GetComponent <Rigidbody>();

        JumpCamera.Setup(jumper);

        strengthUI.Setup(jumper, Trampo);

        SwitchToInitial();
    }
Esempio n. 2
0
 public void Setup(Jumper jumper)
 {
     this.jumper     = jumper;
     this.jumperBody = jumper.GetComponent <Rigidbody>();
     this.cameraBody = this.GetComponent <Rigidbody>();
     this.SyuTyuSen.Stop();
 }