Пример #1
0
        public void Copy(BehaviourModeRuleObject _rule)
        {
            if (_rule == null)
            {
                return;
            }

            base.Copy(_rule);

            Animation.Copy(_rule.Animation);
            Look.Copy(_rule.Look);
            Audio.Copy(_rule.Audio);
            Inventory.Copy(_rule.Inventory);
            Events.Copy(_rule.Events);
            Effect.Copy(_rule.Effect);
            Link.Copy(_rule.Link);
            Move.Copy(_rule.Move);
            Body.Copy(_rule.Body);
            Influences.Copy(_rule.Influences);

            Key                 = _rule.Key;
            LengthMax           = _rule.LengthMax;
            LengthMin           = _rule.LengthMin;
            LengthMaximum       = _rule.LengthMaximum;
            Weight              = _rule.Weight;
            UseCustomLength     = _rule.UseCustomLength;
            FoldoutCustomLength = _rule.FoldoutCustomLength;
        }
 public void AddInfluenceSource(Influences influence,
                                float magnitude,
                                float duration)
 {
     AddInfluence(influence, magnitude);
     InfluenceLifetime.Add(influence, duration);
 }
 public IList <IInfluenceNode> RankNodeNeighboursByInfluence(IEnumerable <IInfluenceNode> nodes,
                                                             Influences influence)
 {
     return((from node in nodes
             where node.InfluenceMagnitudes.ContainsKey(influence)
             orderby node.InfluenceMagnitudes[influence], node.InfluenceMagnitudes.Values.Sum()
             select node).ToList());
 }
 private IList <IInfluenceNode> RankNodeNeighboursByInfluenceMagnitude(IEnumerable <IInfluenceNode> nodes,
                                                                       Influences influence)
 {
     return((from node in nodes
             where node.InfluenceMagnitudes.Keys.Contains(influence)
             orderby node.InfluenceMagnitudes[influence]
             select node).ToList());
 }
Пример #5
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
        public void Copy(DurabilityCompositionObject _composition)
        {
            Attributes.Clear();
            foreach (DurabilityAttributeObject _attribute in _composition.Attributes)
            {
                Attributes.Add(new DurabilityAttributeObject(_attribute));
            }

            Influences.Clear();
            foreach (DurabilityInfluenceObject _influence in _composition.Influences)
            {
                Influences.Add(new DurabilityInfluenceObject(_influence));
            }
        }
        public bool PrepareRuleTarget(ICEWorldBehaviour _component, TargetObject _target)
        {
            if (!Enabled || !OwnerIsReady(_component))
            {
                return(false);
            }

            // By default an additional interactor rule have the same TargetGameObject as the initial rule but while
            // Selectors.Preselection.Enabled is true the rule will select its own best target of the same type according
            // to the specifier pre-selection criteria
            if (Selectors.Preselection.Enabled)
            {
                if (PrepareTargetGameObject(_component) == null || !IsValidAndReady)
                {
                    return(false);
                }
            }
            else
            {
                if (_target == null || _target.IsValidAndReady == false)
                {
                    return(false);
                }

                OverrideTargetGameObject(_target.TargetGameObject);
            }

            if (OverrideInfluences == false)
            {
                Influences.Copy(_target.Influences);
            }

            //if( Selectors.UseDefaultPriority )
            //	Selectors.Priority = _target.Selectors.Priority;

            if (OverrideTargetMovePosition == false)
            {
                Move.Copy(_target.Move);
            }

            Behaviour.CurrentBehaviourModeKey = GetBestBehaviourModeKey(Owner);

            return(true);
        }
        public void Copy(SurfaceDataObject _object)
        {
            if (_object == null)
            {
                return;
            }

            base.Copy(_object);

            Name = _object.Name;
            UseBehaviourModeKey = _object.UseBehaviourModeKey;
            BehaviourModeKey    = _object.BehaviourModeKey;

            Audio.Copy(_object.Audio);
            Effect.Copy(_object.Effect);
            Influences.Copy(_object.Influences);

            Textures = _object.Textures;
        }
Пример #9
0
        public void SetActive(bool _value)
        {
            if (_value == true && m_Active == false && Enabled)
            {
                m_Active = true;

                Move.Altitude.Init();
                Effect.Start(OwnerComponent);
                Events.Start(OwnerComponent);
                Inventory.Start();
                Influences.Start();
            }
            else if (_value == false)
            {
                m_Active = false;

                m_Runtime = 0;

                Effect.Stop();
                Events.Stop();
                Inventory.Stop(OwnerComponent);
                Influences.Stop(OwnerComponent);
            }
        }
Пример #10
0
 public void SetInfluenceMagnitude(Influences influence,
                                   float magnitude)
 {
     InfluenceMagnitudes[influence] = magnitude;
 }
 public void RemoveInfluenceSource(Influences influence)
 {
     RemoveInfluence(influence);
     InfluenceLifetime.Remove(influence);
 }
 public void SetInfluenceSourceLifetime(Influences influence,
                                        float lifetime = -1f)
 {
     InfluenceLifetime[influence] = lifetime;
 }
 public void UpdateInfluenceSourceLifetime(Influences influence,
                                           float lifetimeDelta)
 {
     InfluenceLifetime[influence] += lifetimeDelta;
 }
Пример #14
0
 public void AddInfluence(Influences influence,
                          float magnitude)
 {
     InfluenceMagnitudes.Add(influence, magnitude);
 }
Пример #15
0
 public void UpdateInfluenceMagnitude(Influences influence,
                                      float magnitudeDelta)
 {
     InfluenceMagnitudes[influence] += magnitudeDelta;
 }
 public float GetInfluenceSourceLifetime(Influences influence)
 {
     return(InfluenceLifetime[influence]);
 }
Пример #17
0
 public void RemoveInfluence(Influences influence)
 {
     InfluenceMagnitudes.Remove(influence);
 }
 public override void Reset()
 {
     Attributes.Clear();
     Influences.Clear();
 }