Ejemplo n.º 1
0
        void Start()
        {
            List <string> animationFiles = new List <string>();

            animationFiles.Add("take-1_DEFAULT_C26");
            animationFiles.Add("take-2_DEFAULT_C26");
            animationFiles.Add("take-3_DEFAULT_C26");
            animationFiles.Add("take-4_DEFAULT_C26");
            animationFiles.Add("take-5_DEFAULT_C26");
            animationFiles.Add("take-6_DEFAULT_C26");

            // We assume that the Character has the correct structure
            this._model = this.gameObject.transform;
            this._mc    = new MovementComponent(this._model);
            this._fc    = new FollowerComponent(this._model);
            this._ac    = new AnimationComponent(this._model);
            this._rc    = new RuntimeComponent(this._fc, animationFiles, RecalculateAnimationsFlag);

            if (this._model == null)
            {
                throw new System.Exception("SalamanderController was unable to find the model.");
            }

            // Initialize Trajectory's past to the initial position
            for (int i = 0; i < FeaturePastPoints; i++)
            {
                this._trajectory.points.Add(new Trajectory.Point(new Vector2(0f, 0f), Quaternion.identity));
            }
        }
Ejemplo n.º 2
0
        void Start()
        {
            // We assume that the Character has the correct structure
            Transform character = this.gameObject.transform;

            this._model = character.GetChild(0);
            this._mc    = new MovementComponent(character);
            this._fc    = new FollowerComponent(this._model);
            this._rc    = new RuntimeComponent(this._fc);
            this._ac    = new AnimationComponent(this._model.GetChild(0));

            // Initialize Trajectory's past to the initial position
            for (int i = 0; i < FeaturePastPoints; i++)
            {
                this._trajectory.points.Add(new Trajectory.Point(new Vector2(0f, 0f), Quaternion.identity));
            }
        }