public void Load(PlayerBehaviour runner) { if (runner.transform.Find(vehicleObject.name + "(Clone)")) { Debug.LogError("Trying to load again a vehicle! " + vehicleObject.name + "(Clone)"); } else { Instantiate(vehicleObject, runner.transform); } }
public IEnumerator TurnOn(PlayerBehaviour runner) { Debug.Log("Turn on rocket"); if (runner.transform.Find(vehicleObject.name + "(Clone)").TryGetComponent(out Animator animator)) { animator.SetBool("IsRunning", true); } else { Debug.LogError("No vehicle instance!"); } yield return(null); }