public void InteractClick() { NPC npc = ConfigManager.npc_config.npcs.Find((a) => { return(a.ID == ID); }); btn.SetActive(isCanRepeatTalk); DialogView view = UIManager._instance.OpenView <DialogView>(); view.SetContenct(npc._callback_name, npc.talks.ToArray()); isTalkOneTime = true; }
private void OnEnable() { if (isTalk) { isReset = false; _machine.RegisterState(new Boss_BulletState("bullet", this)); _machine.RegisterState(new Boss_AttackState("attack", this)); _machine.RegisterState(new Boss_AirAttackState("airattack", this)); Timer.Register(2, () => { _anim.SetTrigger("disappear"); }); Timer.Register(3, () => { ReleaseSkill(); }); } else { NPC npc = ConfigManager.npc_config.npcs.Find((a) => { return(a.ID == 102); }); DialogView view = UIManager._instance.OpenView <DialogView>(); view.SetContenct(npc._callback_name, npc.talks.ToArray()); } }
private void Awake() { _instance = this; VirtualCamera = VirtualCameras[0]; if (!SaveData.isHaveData()) { Timer.Register(3, () => { NPC npc = ConfigManager.npc_config.npcs.Find((a) => { return(a.ID == 100); }); DialogView view = UIManager._instance.OpenView <DialogView>(); view.SetContenct(npc._callback_name, npc.talks.ToArray()); }); for (int i = 0; i < SaveDoors.Length; i++) { DoorDic.Add(SaveDoors[i].GetComponent <SaveDoor>().id, false); } } else { DoorDic = SaveData.data.Doors; } }
new void Start() { base.Start(); _anim = GetComponent <Animator>(); _hurtcontroller._DieCallBack += () => { if (nexttimer != null) { nexttimer.Cancel(); } _anim.SetTrigger("firstdisappear"); CancelInvoke(); Timer.Register(1, () => { transform.position = new Vector3(diePos.position.x, diePos.position.y); _anim.SetTrigger("die"); GetComponent <BoxCollider2D>().enabled = false; Timer.Register(0.5f, () => { transform.DOMoveY(diePos.position.y, 0.5f).SetEase(Ease.Linear); Timer.Register(0.15f, () => { DOTween.Shake(() => game.Scene._instance.VirtualCamera.GetComponent <CinemachineCameraOffset>().m_Offset, x => game.Scene._instance.VirtualCamera.GetComponent <CinemachineCameraOffset>().m_Offset = x, 0.3f, 1f); AudioManager._instance.PlayBgm("普通"); }); }); }); Timer.Register(1.5f, () => { NPC npc = ConfigManager.npc_config.npcs.Find((a) => { return(a.ID == 103); }); DialogView view = UIManager._instance.OpenView <DialogView>(); view.SetContenct(npc._callback_name, npc.talks.ToArray()); }); }; _hurtcontroller._HurtCallBack += () => { if (_hurtcontroller.Health > 0 && !isToSecond) { if (_hurtcontroller.Health <= 8 && Stage == 1) { isToSecond = true; if (nexttimer != null) { nexttimer.Cancel(); } CancelInvoke(); lastindex = -1; isReset = true; _anim.SetTrigger("disappear"); Timer.Register(1, () => { transform.rotation = Quaternion.identity; transform.position = ToSecondPos.position; _anim.SetTrigger("appear"); Timer.Register(0.5f, () => { _anim.SetTrigger("idle"); Timer.Register(2, () => { _anim.SetTrigger("tosecond"); Stage = 2; _anim.SetInteger("stage", Stage); Timer.Register(2f, () => { _anim.SetTrigger("disappear"); Timer.Register(1, () => { isToSecond = false; isReset = false; ReleaseSkill(); }); }); }); }); }); } else if (_anim.IsAnim("Attack2")) { _anim.SetTrigger("firstdisappear"); if (nexttimer != null) { nexttimer.Cancel(); } (_machine.GetState("attack") as Boss_AttackState).isattack = false; Timer.Register(1f, () => { ReleaseSkill(); }); } } GameObject temp2 = GameObjectPool.GetInstance().GetGameObject("主角攻击特效", transform.position, Quaternion.identity); GameObjectPool.GetInstance().ReleaseGameObject("主角攻击特效", temp2, 0.5f); }; }