Exemplo n.º 1
0
        void Client_ReceiveFireEvent(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            bool alternative = reader.ReadBoolean();

            if (!reader.Complete())
            {
                return;
            }

            GunType.GunMode typeMode = alternative ? Type.AlternativeMode : Type.NormalMode;
            OnFire(typeMode);
        }
Exemplo n.º 2
0
        void OnFire(GunType.GunMode typeMode)
        {
            //update animation tree
            if (!string.IsNullOrEmpty(typeMode.FireAnimationTrigger))
            {
                foreach (AnimationTree tree in GetAllAnimationTrees())
                {
                    tree.ActivateTrigger(typeMode.FireAnimationTrigger);
                }

                Unit parentUnit = GetParentUnit();
                if (parentUnit != null)
                {
                    foreach (AnimationTree parentTree in parentUnit.GetAllAnimationTrees())
                    {
                        parentTree.ActivateTrigger(typeMode.FireAnimationTrigger);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void OnFire(GunType.GunMode typeMode)
        {
            //update animation tree
            if (!string.IsNullOrEmpty(typeMode.FireAnimationTrigger))
            {
                foreach (AnimationTree tree in GetAllAnimationTrees())
                {
                    tree.ActivateTrigger(typeMode.FireAnimationTrigger);
                }

                Unit parentUnit = GetParentUnit();
                if (parentUnit != null)
                {
                    foreach (AnimationTree parentTree in parentUnit.GetAllAnimationTrees())
                    {
                        parentTree.ActivateTrigger(typeMode.FireAnimationTrigger);
                    }
                }
            }

            readyTime = resetTime = typeMode.BetweenFireTime;
            countdown = true;
        }