public IEnumerator introduceObject(ObjectOfInterest objectOfInterest) { //audioSource.clip = objectOfInterest.introductionSound; //audioSource.Play(); speechOut.Speak(objectOfInterest.description); PantoHandle pantoHandle = objectOfInterest.isOnUpper ? (PantoHandle)GetPantoGameObject().GetComponent <UpperHandle>() : (PantoHandle)GetPantoGameObject().GetComponent <LowerHandle>(); if (objectOfInterest.traceShape) { List <GameObject> children = new List <GameObject>(); foreach (Transform child in objectOfInterest.transform) { children.Add(child.gameObject); } children.Sort((GameObject g1, GameObject g2) => g1.name.CompareTo(g2.name)); yield return(pantoHandle.TraceObjectByPoints(children, 0.2f)); } else { yield return(pantoHandle.SwitchTo(objectOfInterest.gameObject, 0.2f)); } GetPantoGameObject().GetComponent <LowerHandle>().Free(); GetPantoGameObject().GetComponent <UpperHandle>().Free(); }
public override void Update() { float h = Input.GetAxisRaw("Horizontal"); float v = Input.GetAxisRaw("Vertical"); if (h != 0f && v == 0f) { movement.Set(h, v); if (collisionManagement.CanMove(movement)) { playerRef.Move(new Vector3(playerRef.speed * Time.deltaTime * h, 0f, 0f)); } } else if (v != 0f && h == 0f) { movement.Set(h, v); if (collisionManagement.CanMove(movement)) { playerRef.Move(new Vector3(0f, playerRef.speed * Time.deltaTime * v, 0f)); } } if (Input.GetKey(KeyCode.Space)) { GameObject collisionObject = collisionManagement.GetCollisionObject(); if (collisionObject != null) { ObjectOfInterest interaction = collisionObject.GetComponent <ObjectOfInterest>(); if (interaction != null) { Debug.Log("Interaction = " + interaction); interaction.Activate(); } } } }
public bool DrawMenuItem(ObjectOfInterest ooi) { bool selectedBtn = false; GUI.skin = Config.Skin; GUI.BeginGroup(position); selectedBtn = GUI.Button(buttonRect, ""); if (selectedBtn) { selected = !selected; if (selected) { OnSelect.Invoke(ooi); } else { OnDeselect.Invoke(ooi); } } GUI.DrawTexture(iconRect, selected ? iconSelected : icon); GUI.Label(labelRect, selected ? commandSelected : command); GUI.EndGroup(); return(selectedBtn); }
public void RemoveTarget(ObjectOfInterest target) { RemoveTarget(target.node); }
public void AddTarget(ObjectOfInterest target) { AddTarget(target.node); }
public ReadingMessage(Player player, ObjectOfInterest triggerObject) { playerRef = player; this.triggerObject = triggerObject; }