public void UpdateObserver(Subject subject) { if (subject is Init) { movement = 0.05f; rotation = 2.5f; character = GameObject.Find("Bard"); colHandler = character.AddComponent <BardCol>(); } else if (subject is taverne) { spawnPos = tavern.getSpawnVert(); character.transform.position = new Vector3(spawnPos[0].x, 0.6f, spawnPos[0].z); character.transform.Translate((spawnPos[3].x - spawnPos[0].x) / 2, 0, (spawnPos[3].z - spawnPos[0].z) / 2); // Set LookAt Point character.transform.LookAt(new Vector3(0, 0, 0)); character.transform.Rotate(0, -90, 0); //init.UpdateJoint(); NotifyAll(); } else if (subject is Collision) { if (character.GetComponent <Rigidbody>() == null) { col.SetBardRB(); } colHandler.AddColHandler(character, movement, rotation); colHandler.SetBardRB(); rb = character.GetComponent <Rigidbody>(); rb.constraints = RigidbodyConstraints.FreezePositionX; rb.constraints = RigidbodyConstraints.FreezePositionZ; debugging = true; } }
void MoveToStartPoint() { BardCol bc = bard.GetComponent <BardCol>(); bc.MoveTo(startPoint, transform.parent.position, this); }