Esempio n. 1
0
        public MotionMatchingState(string name, MotionMatchingStateType type, int index, int stateID)
        {
            this.name               = name;
            this.stateType          = type;
            this.index              = index;
            this.nodeID             = stateID;
            poseCostType            = PoseCostType.Position;
            trajectoryCostType      = TrajectoryCostType.PositionVelocityOrientation;
            trajectoryCostWeight    = 1f;
            poseCostWeight          = 1f;
            transitions             = new List <Transition>();
            speedMultiplier         = 1f;
            whereCanFindingNextPose = new List <float2>();
            motionDataGroups        = new List <MotionDataGroup>();
            motionDataGroups.Add(new MotionDataGroup("MotionGroup"));

            switch (this.stateType)
            {
            case MotionMatchingStateType.MotionMatching:
                mmFeatures = new MotionMatchingStateFeatures();
                break;

            case MotionMatchingStateType.SingleAnimation:
                saFeatures = new SingleAnimationStateFeatures();
                break;

            case MotionMatchingStateType.ContactAnimationState:
                csFeatures = new ContactStateFeatures();
                break;
            }
        }
Esempio n. 2
0
        public void OnAfterDeserialize()
        {
            switch (this.stateType)
            {
            case MotionMatchingStateType.MotionMatching:
                this.saFeatures = null;
                break;

            case MotionMatchingStateType.SingleAnimation:
                this.mmFeatures = null;
                break;
            }
        }