public void DispatchAddCharacter(int npcId, App.Model.ActionType actionType, App.Model.Direction direction, int x, int y, bool isPlayer) { if (AddCharacterHandler != null) { AddCharacterHandler(npcId, actionType, direction, x, y, isPlayer); } }
public void DispatchSetNpcAction(int npcId, App.Model.ActionType actionType) { if (SetNpcActionHandler != null) { SetNpcActionHandler(npcId, actionType); } }
private void ActionChanged(App.Model.ActionType oldvalue, App.Model.ActionType newvalue) { string animatorName = string.Format("{0}_{1}_{2}", ViewModel.MoveType.ToString(), App.Util.WeaponManager.GetWeaponTypeAction(ViewModel.WeaponType.Value, newvalue), newvalue.ToString()); if (!this.gameObject.activeInHierarchy) { return; } animator.Play(animatorName); if (newvalue != App.Model.ActionType.idle) { this.Controller.SendMessage("AddDynamicCharacter", this, SendMessageOptions.DontRequireReceiver); return; } if (ViewModel.Hp.Value > 0) { this.StartCoroutine(RemoveDynamicCharacter()); return; } Holoville.HOTween.HOTween.To(this, 1f, new Holoville.HOTween.TweenParms().Prop("alpha", 0f).OnComplete(() => { this.gameObject.SetActive(false); this.alpha = 1f; if (sequenceStatus != null) { sequenceStatus.Kill(); } if (App.Util.SceneManager.CurrentScene != null) { App.Util.SceneManager.CurrentScene.StartCoroutine(RemoveDynamicCharacter()); } })); }
public void Setaction(string[] arguments) { int npcId = int.Parse(arguments[0]); App.Model.ActionType actionType = (App.Model.ActionType)Enum.Parse(typeof(App.Model.ActionType), arguments[1]); Global.sharpEvent.DispatchSetNpcAction(npcId, actionType); }
public void Setselfaction(string[] arguments) { int index = int.Parse(arguments[0]); App.Model.ActionType actionType = (App.Model.ActionType)Enum.Parse(typeof(App.Model.ActionType), arguments[1]); CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap; if (cBaseMap == null) { LSharpScript.Instance.Analysis(); return; } cBaseMap.SetSelfAction(index, actionType); }
void AddCharacterHandler(int npcId, App.Model.ActionType actionType, App.Model.Direction direction, int x, int y, bool isPlayer) { Debug.LogError("VScenarioMap AddCharacterHandler"); Model.Character.MCharacter character = NpcCacher.Instance.GetFromNpc(npcId); character.StatusInit(); character.action = actionType; GameObject obj = character.staticAvatar == 0 ? Instantiate(Global.characterPrefab) : Instantiate(Global.avatarPrefab); obj.transform.SetParent(characterLayer); obj.transform.localScale = Vector3.one * 0.6f; //float x = character.coordinate.x * 0.64f + 0.32f + (character.coordinate.y % 2 == 0 ? 0 : 0.32f); obj.transform.localPosition = new Vector3(x * 0.32f, -4.4f, 0); obj.SetActive(true); Avatar.VCharacterBase vCharacter = obj.GetComponent <Avatar.VCharacterBase>(); vCharacter.UpdateView(character); vCharacter.direction = direction; Global.charactersManager.vCharacters.Add(vCharacter); if (isPlayer) { Global.charactersManager.mainVCharacter = vCharacter; } }
public void Add(string[] arguments) { int npcId = int.Parse(arguments[0]); string action = arguments[1]; if (action == "stand") { action = "idle"; } string directionStr = arguments[2]; int x = int.Parse(arguments[3]); int y = int.Parse(arguments[4]); CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap; if (cBaseMap == null) { LSharpScript.Instance.Analysis(); return; } App.Model.ActionType actionType = (App.Model.ActionType)Enum.Parse(typeof(App.Model.ActionType), action); App.Model.Direction direction = (App.Model.Direction)System.Enum.Parse(typeof(App.Model.Direction), directionStr, true); cBaseMap.AddCharacter(npcId, actionType, direction, x, y); LSharpScript.Instance.Analysis(); }
public void AddCharacter(int npcId, App.Model.ActionType actionType, App.Model.Direction direction, int x, int y) { }
public void ChangeAction(App.Model.ActionType type) { ViewModel.Action.Value = type; }