Пример #1
0
        /// <summary>
        /// Constructor for deserialization.
        /// </summary>
        /// <param name="info">The serialization info to deserialize with.</param>
        /// <param name="context">The context in which to deserialize...?</param>
        protected Scene_cl(SerializationInfo info, StreamingContext context)
        {
            mAmbientLight = (Entity_cl)info.GetValue("AmbientLight", typeof(Entity_cl));
            LightManager_cl.Instance.ActiveAmbientLight = (AmbientLightComponent)mAmbientLight.GetComponentOfType(typeof(AmbientLightComponent));

            mLights = (List<Entity_cl>)info.GetValue("Lights", typeof(List<Entity_cl>));
            mEntities = (List<Entity_cl>)info.GetValue("Prefabs", typeof(List<Entity_cl>));
            mLayers = (List<Entity_cl>)info.GetValue("Layers", typeof(List<Entity_cl>));
        }
Пример #2
0
        /// <summary>
        /// Processes the appropriate query to the input component.
        /// </summary>
        /// <param name="entity">entity is the relevant entity of whos components we will query.</param>
        /// <param name="next">next is the next script node in this script of whos input value we will set with our output.</param>
        public override void ProcessNode(Entity_cl entity, string next)
        {
            InputComponent_cl input = (InputComponent_cl)(entity.GetComponentOfType(typeof(InputComponent_cl)));
            object output;
            INode nextNode = ScriptNodeManager_cl.Instance.GetNode(next);

            switch (mScriptType)
            {
                case InputScriptType.TYPE_BUTTON_DOWN:
                    output = input.IsButtonDown(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_UP:
                    output = input.IsButtonUp(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_WAS_DOWN:
                    output = input.WasButtonDown(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_WAS_UP:
                    output = input.WasButtonUp(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_PRESSED_THIS_FRAME:
                    output = input.WasButtonPressedThisFrame(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_RELEASED_THIS_FRAME:
                    output = input.WasButtonReleasedThisFrame(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_BUTTON_HELD:
                    output = input.IsButtonHeld(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_DOWN:
                    output = input.IsKeyDown(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_UP:
                    output = input.IsKeyUp(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_WAS_DOWN:
                    output = input.WasKeyDown(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_WAS_UP:
                    output = input.WasKeyUp(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_PRESSED_THIS_FRAME:
                    output = input.WasKeyPressedThisFrame(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_RELEASED_THIS_FRAME:
                    output = input.WasKeyReleasedThisFrame(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_KEY_HELD:
                    output = input.IsKeyHeld(mInput);
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_LEFT_STICK_MAGNITUDE:
                    output = input.LeftStickPosition().Length();
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_LEFT_STICK_POSITION:
                    output = input.LeftStickPosition();
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_LEFT_STICK_ACTIVE:
                    output = input.LeftStickPosition().Length() > InputComponent_cl.mThumbStickDeadZone;
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_RIGHT_STICK_MAGNITUDE:
                    output = input.RightStickPosition().Length();
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_RIGHT_STICK_POSITION:
                    output = input.RightStickPosition();
                    nextNode.SetInputValue(output);
                    break;

                case InputScriptType.TYPE_RIGHT_STICK_ACTIVE:
                    output = input.LeftStickPosition().Length() > InputComponent_cl.mThumbStickDeadZone;
                    nextNode.SetInputValue(output);
                    break;
            }
        }
Пример #3
0
 /// <summary>
 /// Process node is the main script method which performs the function of a ScriptNode.
 /// </summary>
 /// <param name="entity">entity is the entity of whos components are relevant to the current script.</param>
 /// <param name="next">next is the next ScriptNode in the current script of whos input we will set with the current node's output.</param>
 public override void ProcessNode(Entity_cl entity, string next)
 {
     PlayerControllerComponent_cl controller = (PlayerControllerComponent_cl)(entity.GetComponentOfType(typeof(PlayerControllerComponent_cl)));
     controller.ToggleActionChannel(mDefaultValue, mActionChannel);
 }
        /// <summary>
        /// Process node is the main script method which performs the function of a ScriptNode.
        /// </summary>
        /// <param name="entity">entity is the entity of whos components are relevant to the current script.</param>
        /// <param name="next">next is the next ScriptNode in the current script of whos input we will set with the current node's output.</param>
        public override void ProcessNode(Entity_cl entity, string next)
        {
            if (mInput == mPlayIfTrue)
            {
                AnimatedComponent_cl animated = (AnimatedComponent_cl)(entity.GetComponentOfType(typeof(AnimatedComponent_cl)));
                animated.QueueAnimation(mAnimationToQueue, mFrameToQueue, mSpeedToQueue);
            }

            mInput = false;
        }
 /// <summary>
 /// Process node is the main script method which performs the function of a ScriptNode.
 /// </summary>
 /// <param name="entity">entity is the entity of whos components are relevant to the current script.</param>
 /// <param name="next">next is the next ScriptNode in the current script of whos input we will set with the current node's output.</param>
 public override void ProcessNode(Entity_cl entity, string next)
 {
     AnimatedComponent_cl animated = (AnimatedComponent_cl)(entity.GetComponentOfType(typeof(AnimatedComponent_cl)));
     animated.SetUseMotionDelta(mMotionDeltaOn, mMotionDeltaChannel);
 }