2017-10-05 03:13:27 -05:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
[CreateAssetMenu(menuName = "CharacterStateMachine/Interaction")]
|
|
|
|
|
public class Interaction : ScriptableObject
|
|
|
|
|
{
|
|
|
|
|
// Animation performed by the character
|
2017-10-09 02:03:39 -05:00
|
|
|
|
[Tooltip("Descriptions follow the prompt \"Press 'E' to ...\"")]
|
2017-10-05 03:13:27 -05:00
|
|
|
|
public string interactionDescription;
|
2017-10-09 02:03:39 -05:00
|
|
|
|
[Tooltip("Descriptions follow the prompt \"Press 'E' to ...\"")]
|
|
|
|
|
public string receiverDescription;
|
2017-10-09 18:55:07 -05:00
|
|
|
|
public CharacterAnimator.Params initiatorAnimationTrigger, objectAnimationTrigger;
|
2017-10-05 03:13:27 -05:00
|
|
|
|
public InteractionResult result;
|
2017-10-08 18:37:19 -05:00
|
|
|
|
public float initialRotation;
|
|
|
|
|
public float objectInitialRotation;
|
|
|
|
|
public float interactionDistance = 1.0f;
|
2017-10-05 03:13:27 -05:00
|
|
|
|
|
|
|
|
|
public enum InteractionResult
|
|
|
|
|
{
|
|
|
|
|
Nothing, SpyMissionComplete
|
|
|
|
|
}
|
2017-10-09 18:55:07 -05:00
|
|
|
|
/*
|
2017-10-09 02:03:39 -05:00
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return interactionDescription.GetHashCode() ^ (int)characterInteraction;
|
2017-10-09 18:55:07 -05:00
|
|
|
|
}*/
|
2017-10-09 02:03:39 -05:00
|
|
|
|
|
2017-10-08 18:37:19 -05:00
|
|
|
|
public void ExecuteResult(StateController controller)
|
|
|
|
|
{
|
|
|
|
|
switch(result)
|
|
|
|
|
{
|
|
|
|
|
case InteractionResult.Nothing:
|
|
|
|
|
break;
|
|
|
|
|
case InteractionResult.SpyMissionComplete:
|
|
|
|
|
SpyMissionComplete(controller);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Debug.LogError("Invalid result selected for execution");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------- Result functions ---------------------------------
|
|
|
|
|
void SpyMissionComplete(StateController controller)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("Completed mission");
|
|
|
|
|
}
|
2017-10-05 03:13:27 -05:00
|
|
|
|
}
|