示例#1
0
        public void Initialize(
            Vector2d position = default(Vector2d),
            Vector2d rotation = default(Vector2d))
        {
            IsActive     = true;
            CheckCasting = true;


            CachedGameObject.SetActive(true);
            if (Body.IsNotNull())
            {
                Body.Initialize(position.ToVector3d(), rotation);
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Initialize();
            }



            abilityManager.Initialize();
            if (Animator.IsNotNull())
            {
                Animator.Initialize();
            }
        }
示例#2
0
        private void _Deactivate()
        {
            IsActive = false;

            IsSelected = false;
            SpawnVersion++;
            if (onDeactivation.IsNotNull())
            {
                onDeactivation(this);
            }

            abilityManager.Deactivate();

            Body.Deactivate();
            if (Influencer.IsNotNull())
            {
                Influencer.Deactivate();
            }

            if (StatsBarer != null)
            {
                StatsBarer.Deactivate();
            }
            if (Ringer.IsNotNull())
            {
                Ringer.Deactivate();
            }
        }
示例#3
0
        public virtual void Initialize(
            Vector2d position = default(Vector2d),
            Vector2d rotation = default(Vector2d))
        {
            IsActive     = true;
            CheckCasting = true;

            // put game object under it's agent commander
            CachedGameObject.transform.parent = this.Controller.Commander.GetComponentInChildren <RTSAgents>().transform;

            CachedGameObject.SetActive(true);
            if (Body.IsNotNull())
            {
                Body.Initialize(position.ToVector3d(), rotation);
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Initialize();
            }

            abilityManager.Initialize();
            if (Animator.IsNotNull())
            {
                Animator.Initialize();
            }
        }
示例#4
0
        public void Initialize(
            Vector2d position = default(Vector2d),
            Vector2d rotation = default(Vector2d))
        {
            IsActive     = true;
            CheckCasting = true;


            CachedGameObject.SetActiveIfNot(true);
            if (Body.IsNotNull())
            {
                Body.Initialize(new Vector2dHeight(position), rotation);
            }

            if (Triggers.IsNotNull())
            {
                foreach (LSTrigger trigger in Triggers)
                {
                    trigger.Initialize();
                }
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Initialize();
            }



            abilityManager.Initialize();
            if (Animator.IsNotNull())
            {
                Animator.Initialize();
            }
        }
示例#5
0
        public void Initialize(
            AgentController controller,
            ushort localID,
            ushort globalID,
            Vector2d position = default(Vector2d),
            Vector2d rotation = default(Vector2d))
        {
            LocalID    = localID;
            GlobalID   = globalID;
            Controller = controller;

            IsActive     = true;
            CheckCasting = true;
            Selectable   = true;


            CachedGameObject.SetActiveIfNot(true);
            if (Body.IsNotNull())
            {
                Body.Initialize(new Vector2dHeight(position), rotation);
            }

            if (Triggers.IsNotNull())
            {
                foreach (LSTrigger trigger in Triggers)
                {
                    trigger.Initialize();
                }
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Initialize();
            }

            if (Animator.IsNotNull())
            {
                Animator.Initialize();
            }

            abilityManager.Initialize();
            if (StatsBarer != null)
            {
                StatsBarer.Initialize();
            }
            if (Ringer.IsNotNull())
            {
                Ringer.Initialize();
                IsSelected    = false;
                IsHighlighted = false;
            }
            if (onInitialized != null)
            {
                onInitialized(this);
            }
        }
示例#6
0
        public void Simulate()
        {
            if (Influencer.IsNotNull())
            {
                Influencer.Simulate();
            }

            abilityManager.Simulate();

            if (IsCasting == false)
            {
                SetState(AnimState.Idling);
            }
        }
示例#7
0
        private void _Deactivate()
        {
            IsActive = false;

            IsSelected = false;
            SpawnVersion++;

            abilityManager.Deactivate();

            Body.Deactivate();
            if (Influencer.IsNotNull())
            {
                Influencer.Deactivate();
            }
        }
示例#8
0
        private void _Deactivate()
        {
            this.StopCast();

            IsSelected = false;

            abilityManager.Deactivate();

            Body.Deactivate();
            if (Influencer.IsNotNull())
            {
                Influencer.Deactivate();
            }

            SpawnVersion++;
            IsActive = false;
        }
示例#9
0
        public void Initialize(
            AgentController controller,
            ushort localID,
            ushort globalID,
            Vector2d position = default(Vector2d))
        {
            LocalID    = localID;
            GlobalID   = globalID;
            Controller = controller;

            IsActive     = true;
            CheckCasting = true;
            Selectable   = true;


            CachedGameObject.SetActive(true);
            if (Body.IsNotNull())
            {
                Body.Initialize(position, Vector2d.up);
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Initialize();
            }

            if (Animator.IsNotNull())
            {
                Animator.Initialize();
            }

            abilityManager.Initialize();
            if (StatsBarer != null)
            {
                StatsBarer.Initialize();
            }
            if (Ringer.IsNotNull())
            {
                Ringer.Initialize();
                IsSelected    = false;
                IsHighlighted = false;
            }
        }
示例#10
0
        public virtual void Simulate()
        {
            if (!_provisioned)
            {
                _provisioned = true;
                _cachedCommander.CachedResourceManager.AddResource(ResourceType.Provision, resourceCost[ResourceType.Provision]);
            }

            if (Influencer.IsNotNull())
            {
                Influencer.Simulate();
            }

            abilityManager.Simulate();

            if (Animator.IsNotNull() && IsCasting == false)
            {
                Animator.SetIdleState();
            }
        }