Exemple #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (checkPointControl == null)
     {
         checkPointControl = this;
         DontDestroyOnLoad(checkPointControl);
     }
     else
     {
         Destroy(gameObject);
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log(distanceGround + "start");
        charController = GetComponent <CharacterController>();
        distanceGround = GetComponent <Collider>().bounds.extents.y;
        anim.SetBool("Jump", false);
        current         = transform.position;
        _startMoveSpeed = _moveSpeedCurrent;
        closeWay[1].SetActive(false);
        _centerCharacter = charController.center;

        checkPointControl  = GameObject.FindGameObjectWithTag("CPC").GetComponent <CheckPointControl>();
        transform.position = checkPointControl.lastCheckPos;
    }
Exemple #3
0
 // Start is called before the first frame update
 void Start()
 {
     check = GameObject.FindGameObjectWithTag("CPC").GetComponent <CheckPointControl>();
 }