Example #1
0
 public override void Dead()
 {
     base.Dead();
     animator.SetTrigger(aniDead);
     bt.DisableBehavior();
     GameObjectInScene.GetComponent <Collider>().enabled = false;
     GameMainProgram.Instance.eventMgr.InvokeEvent(EventName.BossDead);
 }
Example #2
0
 /// <summary>
 /// Initialize只在第一次创建时执行初始化代码,之后切换Scene时都不用再次初始化,所以Data也没有改变
 /// </summary>
 /// <param name="gameObject"></param>
 public IPlayer(GameObject gameObject) : base(gameObject)
 {
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rg2d     = GameObjectInScene.GetComponent <Rigidbody2D>();
     }
 }
Example #3
0
 public IEnemy(GameObject gameObject) : base(gameObject)
 {
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rg2d     = GameObjectInScene.GetComponent <Rigidbody2D>();
         // 关联中介者
         EnemyMedi = new EnemyMediator(this);
         EnemyMedi.Initialize();
     }
 }
Example #4
0
 /// <summary>
 /// Initialize只在第一次创建时执行初始化代码,之后切换Scene时都不用再次初始化,所以Data也没有改变
 /// </summary>
 /// <param name="gameObject"></param>
 public IPlayer(GameObject gameObject) : base(gameObject)
 {
     Speed = 5;
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rgbd     = GameObjectInScene.GetComponent <Rigidbody>();
         // 关联中介者
         PlayerMedi = new PlayerMediator(this);
         PlayerMedi.Initialize();
     }
 }
Example #5
0
 /// <summary>
 /// Initialize只在第一次创建时执行初始化代码,之后切换Scene时都不用再次初始化,所以Data也没有改变
 /// </summary>
 /// <param name="gameObject"></param>
 public IPlayer(GameObject gameObject) : base(gameObject)
 {
     Props = GameMainProgram.Instance.dataBaseMgr.Props;
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rgbd     = GameObjectInScene.GetComponent <Rigidbody>();
         // 关联中介者
         PlayerMedi = new PlayerMediator(this);
         PlayerMedi.Initialize();
     }
 }
Example #6
0
        public override void Dead()
        {
            base.Dead();
            animator.SetTrigger(aniDead);
            bt.DisableBehavior();
            hasFlail = true;
            GameObjectInScene.GetComponent <Collider>().enabled = false;
            GameMainProgram.Instance.eventMgr.InvokeEvent(EventName.BossDead);
            // 渐隐消失
            CaptainMono captainMono = EnemyMedi.EnemyMono as CaptainMono;

            CoroutineMgr.Instance.StartCoroutine(captainMono.DeadFadeOut());
        }
Example #7
0
 public IEnemy(GameObject gameObject) : base(gameObject)
 {
     Type = EnemyType.Monster;
     if (GameObjectInScene != null)
     {
         animator     = GameObjectInScene.GetComponent <Animator>();
         Rgbd         = GameObjectInScene.GetComponent <Rigidbody>();
         bt           = GameObjectInScene.GetComponent <BehaviorTree>();
         navMeshAgent = GameObjectInScene.GetComponent <NavMeshAgent>();
         // 关联中介者
         EnemyMedi = new EnemyMediator(this);
         EnemyMedi.Initialize();
     }
 }
Example #8
0
 /// <summary>
 /// Initialize只在第一次创建时执行初始化代码,之后切换Scene时都不用再次初始化,所以Data也没有改变
 /// </summary>
 /// <param name="gameObject"></param>
 public IPlayer(GameObject gameObject) : base(gameObject)
 {
     EquipPack = new IEquip[35];
     PropPack  = new IProp[35];
     Fit       = new int[8] {
         99, 99, 99, 99, 99, 99, 99, 99
     };                                          // 初始值>34表示未装备
     if (GameObjectInScene != null)
     {
         animator = GameObjectInScene.GetComponent <Animator>();
         Rgbd     = GameObjectInScene.GetComponent <Rigidbody>();
         // 关联中介者
         PlayerMedi = new PlayerMediator(this);
         PlayerMedi.Initialize();
     }
     // LoadData(); 请在子类构造函数最尾处调用
 }