Example #1
0
        public override bool Initialize <T>(T mController)
        {
            master                = mController as MasterController;
            transform             = master.PTransform;
            model                 = master.PModel;
            playerCharController  = master.PCharController;
            lookDirection         = Quaternion.identity;
            lastMovementDirection = model.Movement.forward;
            tweenDirection        = Vector3.zero;

            if (!master || !playerCharController || !transform || !model)
            {
                Debug.LogError("The player Movement cannot initialize!");
                Debug.Log("Movement Variables: Master-" + master + " Rigidbody-" + playerCharController);
                Debug.Log("Transform-" + transform + " Model-" + model);
                return(false);
            }
            return(true);
        }
Example #2
0
        void Start()
        {
            PTransform      = transform;
            PCharController = GetComponent <CharacterController>();
            PModel          = GetComponentInChildren <ModelHolder>();
            if (!PMovement)
            {
                Debug.LogError("You need a player Movement behaviour object on " + gameObject.name + "!");
                return;
            }
            if (!PVisualEffects)
            {
                Debug.LogError("You need a player Visual Effects behaviour object on " + gameObject.name + "!");
                return;
            }

            noErrorsAllClear = PMovement.Initialize(this);

            if (noErrorsAllClear)
            {
                noErrorsAllClear = PVisualEffects.Initialize(this);
            }
        }