Exemplo 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();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        rBody = GetComponent <Rigidbody>();
        anim  = GetComponentInChildren <Animator>();

        this.jumpCamera       = game.JumpCamera;
        initCameraJointAnchor = this.jumpCamera.GetComponent <SpringJoint>().connectedAnchor;
        initCameraAngle       = this.jumpCamera.transform.localEulerAngles;
        HeadLight.SetActive(false);
        TrailEffect.gameObject.SetActive(false);
    }