Exemplo n.º 1
0
 void Awake()
 {
     attribute    = GetComponent <NpcAttribute>();
     ai           = new ChestCharacter();
     ai.attribute = attribute;
     ai.AddState(new ChestIdle());
     ai.AddState(new ChestDead());
 }
Exemplo n.º 2
0
        void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;
            //测试可以被推动的怪物
            //attribute.Pushable = true;

            ai           = new ChestCharacter();
            ai.attribute = attribute;
            ai.AddState(new ChestIdle());
            ai.AddState(new ChestDead2());
            ai.AddState(new MonsterKnockBack());
        }
Exemplo n.º 3
0
        void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;
            ai           = new ChestCharacter();
            ai.attribute = attribute;
            ai.AddState(new ChestIdle());
            var bd = new NotMoveDead();

            bd.deadCallback = () =>
            {
                Util.SpawnParticle("barrelbreak", transform.position + new Vector3(0, 0.3f, 0), false);
            };
            ai.AddState(bd);
            ai.AddState(new MonsterKnockBack());
        }
Exemplo n.º 4
0
        void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;

            ai           = new ChestCharacter();
            ai.attribute = attribute;
            ai.AddState(new ChestIdle());
            ai.AddState(new DropBlockDead());

            Util.SetLayer(gameObject, GameLayer.IgnoreCollision2);
            if (NetworkUtil.IsMaster())
            {
                StartCoroutine(Drop());
            }
        }
Exemplo n.º 5
0
        private void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;
            ai           = new ChestCharacter();
            ai.attribute = attribute;
            ai.AddState(new ChestIdle());

            Util.SetLayer(gameObject, GameLayer.IgnoreCollision2);


            var st  = attribute.spawnTrigger;
            var sz  = st.GetComponent <SpawnZone>();
            var old = sz.GetComponent <BoxCollider>();
            var go  = new GameObject();

            go.transform.parent = transform;
            var bc = go.AddComponent <BoxCollider>();

            bc.isTrigger = true;
            bc.center    = old.center;
            bc.size      = old.size;
            Util.InitGameObject(go);
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = sz.transform.localScale;

            var wz = go.AddComponent <WarnZone>();

            wz.light = sz.transform.Find("light").gameObject;
        }
Exemplo n.º 6
0
 private void Awake()
 {
     attribute = GetComponent <NpcAttribute>();
     attribute.ShowBloodBar = false;
     ai           = new ChestCharacter();
     ai.attribute = attribute;
     ai.AddState(new ChestIdle());
 }
Exemplo n.º 7
0
        void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;
            ai           = new ChestCharacter();
            ai.attribute = attribute;

            ai.AddState(new ChestIdle());
            ai.AddState(new NotMoveDead());
            ai.AddState(new MonsterKnockBack());
            Util.SetLayer(gameObject, GameLayer.IgnoreCollision2);

            var g = new GameObject("AddHP");

            g.transform.parent = transform;
            Util.InitGameObject(g);
            g.AddComponent <AddHPComponent>();
        }
Exemplo n.º 8
0
        void Awake()
        {
            attribute = GetComponent <NpcAttribute>();
            attribute.ShowBloodBar = false;
            ai           = new ChestCharacter();
            ai.attribute = attribute;
            var bd = new HideDead();

            ai.AddState(new ChestIdle());
            ai.AddState(bd);
            ai.AddState(new MonsterKnockBack());

            Util.SetLayer(gameObject, GameLayer.IgnoreCollision2);

            var g = new GameObject("HideBloodBar");

            g.transform.parent = transform;
            Util.InitGameObject(g);
            var hb = g.AddComponent <HideBloodBar>();

            bd.deadCallback = hb.RestoreAll;
        }