public HotSpot ReturnMatchingHotSpot(HotSpotLocation hotSpotLocation) { switch (hotSpotLocation) { default: Debug.LogWarning(string.Format("A hot spot for {0} hasn't been set yet.", hotSpotLocation)); return(null); case HotSpotLocation.Teeth: return(_hotSpotTeeth); case HotSpotLocation.Back: return(_hotSpotBack); case HotSpotLocation.Tummy: return(_hotSpotTummy); case HotSpotLocation.Tail: return(_hotSpotTail); } }
/// <summary> /// Registers an action taken on the monster. /// </summary> /// <param name="actionType">Type of input used.</param> /// <param name="hotSpot">Hot spot where the input was used on.</param> public void RegisterAction(ActionType actionType, HotSpotLocation hotSpot) { Debug.Log(string.Format("Registering input of {0} at {1}.", actionType, hotSpot), this); ActionProperties actionProperties = ReturnCurrentActionProperties(); if (actionProperties == null) { return; } //Debug.Log(actionProperties.ActionType + "==" + actionType + " && " + actionProperties.HotSpotLocation + "==" + hotSpot + " && " + actionProperties.holdableType + "==" + _holdObject.currentObject.holdableType); if (actionProperties.ActionType == actionType && actionProperties.HotSpotLocation == hotSpot && actionProperties.holdableType == _holdObject.currentObject.holdableType) { if (actionProperties.ActionType == ActionType.DragAndDrop) { _holdObject.DropObject(); } // Succes! PlayAudio(actionProperties.AudioToPlayOnSucces); AnimationHelper.UpdateAnimation(actionProperties.AnimationTypeOnSucces, 3f); Iterate(); } else if (actionProperties.HotSpotLocation == hotSpot) { return; } else { AnimationHelper.UpdateAnimation(AnimationType.Angry, 3f); Escalate(); } }