private void arriveAtWP(GuestWaypoint wp) { if (wp.fixture != null) { if (shirt == null) { takeShirt(wp.fixture.giveShirt()); } } if (wp.dropWP) { if (shirt != null) { dropShirt(); } } destination = path.getNextDestination(); if (destination == null) { isBeingDestroyed = true; if (shirt != null) { Destroy(shirt.gameObject, 1f); } path.gameObject.SetActive(false); Destroy(path, 1f); //TODO: this doesn't actually destroy the path for some reason Destroy(gameObject, 1f); } }
void Start() { manager = GameObject.FindGameObjectWithTag("PathManager").GetComponent <GuestPathManager>(); path = Instantiate(manager.getPath()); destination = path.getNextDestination(); speed *= Random.Range(0.5f, 1.5f); }