Ejemplo n.º 1
0
        private void AttachBuildingModel()
        {
            GearParent[] gears = (GearParent[])GameObject.FindObjectsOfType(typeof(GearParent));
            foreach (GearParent gear in gears)
            {
                if (gear.ID == (uint)clientTrapId)
                {
                    Transform     = gear.transform;
                    GameObject    = gear.gameObject;
                    Transform.tag = "Monster";

                    Debug.Log("CreateBuildingModel Position: " + Transform.position);

                    // motor = GameObject.AddComponent<MogoMotorServer>();
                    animator = GameObject.GetComponent <Animator>();

                    ActorMonster ap = GameObject.GetComponent <ActorMonster>();
                    if (ap == null)
                    {
                        ap = GameObject.AddComponent <ActorMonster>();
                    }

                    ap.theEntity = this;
                    this.Actor   = ap;

                    golem   = gear.gameObject.GetComponentInChildren <GolemAnimation>();
                    golemFx = gear.gameObject.GetComponentInChildren <GolemFx>();

                    // golem = gear as GolemAnimation;

                    if (golem != null)
                    {
                        golem.Activate();
                    }
                    if (golemFx != null)
                    {
                        golemFx.Activate();
                    }

                    BornedHandler();

                    // base.CreateModel();
                }
            }
        }
Ejemplo n.º 2
0
    protected void ChangeGolem(GolemAnimation theGolem, int currenState)
    {
        if (theGolem != this)
        {
            return;
        }

        if (bloodCondition == null)
        {
            return;
        }

        int temp = 0;

        for (int i = 0; i < bloodCondition.Length; i++)
        {
            if (currenState > bloodCondition[i])
            {
                temp = i - 1 < 0 ? 0 : i - 1;
                break;
            }
        }

        if (temp != index)
        {
            index = temp;
            for (int i = 0; i < golemAnimations.Length; i++)
            {
                if (index != i)
                {
                    golemAnimations[i].gameObject.SetActive(false);
                }
                else
                {
                    golemAnimations[i].gameObject.SetActive(true);
                    Activate();
                }
            }
        }
    }
Ejemplo n.º 3
0
        private void AttachBuildingModel()
        {
            GearParent[] gears = (GearParent[])GameObject.FindObjectsOfType(typeof(GearParent));
            foreach (GearParent gear in gears)
            {
                if (gear.ID == (uint)clientTrapId)
                {
                    Transform = gear.transform;
                    GameObject = gear.gameObject;
                    Transform.tag = "Monster";

                    LoggerHelper.Debug("CreateBuildingModel Position: " + Transform.position);

                    // motor = GameObject.AddComponent<MogoMotorServer>();
                    animator = GameObject.GetComponent<Animator>();

                    ActorMonster ap = GameObject.GetComponent<ActorMonster>();
                    if (ap == null)
                        ap = GameObject.AddComponent<ActorMonster>();

                    ap.theEntity = this;
                    this.Actor = ap;

                    golem = gear.gameObject.GetComponentInChildren<GolemAnimation>();
                    golemFx = gear.gameObject.GetComponentInChildren<GolemFx>();

                    // golem = gear as GolemAnimation;

                    if (golem != null)
                        golem.Activate();
                    if (golemFx != null)
                        golemFx.Activate();

                    BornedHandler();

                    // base.CreateModel();
                }
            }
        }
Ejemplo n.º 4
0
    protected void ChangeGolem(GolemAnimation theGolem, int currenState)
    {
        if (theGolem != this)
            return;

        if (bloodCondition == null)
            return;

        int temp = 0;
        for (int i = 0; i <  bloodCondition.Length; i++)
        {
            if (currenState > bloodCondition[i])
            {
                temp = i - 1 < 0 ? 0 : i - 1;
                break;
            }
        }

        if (temp != index)
        {
            index = temp;
            for (int i = 0; i < golemAnimations.Length; i++)
            {
                if (index != i)
                    golemAnimations[i].gameObject.SetActive(false);
                else
                {
                    golemAnimations[i].gameObject.SetActive(true);
                    Activate();
                }
            }
        }
    }
Ejemplo n.º 5
0
 void Awake()
 {
     playerAnim = GetComponent <GolemAnimation>();
     playerBody = GetComponent <Rigidbody>();
 }
Ejemplo n.º 6
0
 protected void GetGolemGear()
 {
     golemAni = gameObject.GetComponent <GolemAnimation>();
     golemFx  = gameObject.GetComponent <GolemFx>();
 }
Ejemplo n.º 7
0
 protected void GetGolemGear()
 {
     golemAni = gameObject.GetComponent<GolemAnimation>();
     golemFx = gameObject.GetComponent<GolemFx>();
 }