Example #1
0
File: Gun.cs Project: whztt07/SDK
        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 );
                }
            }
        }
Example #2
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;
        }