public AmidaState(GoToYouStage context) : base(context) { lineLayerMask = LayerMask.GetMask("AmidaLine"); amidaMan = context.AmidaMan; personInNeed = Context.PersonInNeed; currentCamera = Camera.main; }
protected override IEnumerator TouchAmidaMan(AmidaMan amidaMan, float fromReactionSec = 0) { var pos = new Vector3(amidaMan.transform.position.x, transform.position.y, amidaMan.transform.position.z); transform.LookAt(pos); Play(AgentAnimatorParameters.Attack); if (movingGear != null) { movingGear.Stop(); } return(base.TouchAmidaMan(amidaMan, fromReactionSec)); }
protected virtual IEnumerator TouchAmidaMan(AmidaMan amidaMan, float fromReactionSec = 0) { if (Mathf.Approximately(fromReactionSec, 0)) { amidaMan.FallBack(); } else { yield return(new WaitForSeconds(fromReactionSec)); amidaMan.FallBack(); } yield break; }
protected override IEnumerator TouchAmidaMan(AmidaMan amidaMan, float fromReactionSec = 0) { var pos = new Vector3(amidaMan.transform.position.x, transform.position.y, amidaMan.transform.position.z); transform.LookAt(pos); Play(AgentAnimatorParameters.Attack); Observable.Timer(TimeSpan.FromSeconds(0.5f)).Subscribe(_ => { Play(BearAnimatorParameters.Eat); }) .AddTo(this); if (movingGear != null) { movingGear.Stop(); } return(base.TouchAmidaMan(amidaMan, fromReactionSec)); }