public override void OnStart() { self = gameObject.GetPersonInfo() as IHighFivePerson; player = GlobalVar.G_Player as IHighFiveCharacter; actor = gameObject.GetComponent <Actor>(); _animator = gameObject.GetComponent <Animator>(); _animator.Play(Animator.StringToHash(walkAni)); }
/// <summary> /// 设置玩家 /// </summary> /// <param name="player"></param> /// <exception cref="Exception"></exception> public static void SetPlayer(IHighFiveCharacter player) { if (null == G_Player) { G_Player = player; } else { throw new Exception($"已经设置G_Player[{G_Player.CharacterName}], 新来的【{player.CharacterName}】"); } }
public void RunSkill(IHighFiveCharacter self, bool ignoreInput, float startTime = 0) { if (!self.InputOk) { return; } var lastTime = LastTime; if (ignoreInput) { self.IgnoreInput(lastTime); } if (isUsed) { foreach (var trigger in triggers) { trigger.Reset(); } } else { this.isUsed = true; } this.startTime = startTime; foreach (var trigger in triggers) { // Debug.Log("Trigger:" + trigger.type); trigger.RunTriggerUnit(self as IHighFivePerson); } MainLoop.Instance.ExecuteLater(() => { if (isUsed) { isUsed = false; } foreach (var VARIABLE in triggers) { VARIABLE.Reset(); } }, lastTime); }
public void RunSkill(IHighFiveCharacter self, bool ignoreInput = false, float startTimer = 0f) => skillAsset.RunSkill(self, ignoreInput, startTimer);
void Start() { this.player = GlobalVar.G_Player; this.beforePos = this.player.position; }