Beispiel #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 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;
        }