void Start()
            {
                gameEntity = gameObject.GetComponent<IGameEntity>() as IGameEntity;
                inputController = gameObject.GetComponent<IGameEntityInput>() as IGameEntityInput;

                terrainCollisionHandler = gameObject.GetComponent<ITerrainCollision>() as ITerrainCollision;
                if (terrainCollisionHandler != null) {
                    terrainCollisionHandler.Initialize();
                }

                characterController = GetComponent<CharacterController>();

                characterController.slopeLimit = slopeLimit;

                animationController = transform.GetComponentInChildren<DefaultAnimationController>();

                swimLevel = Settings.Instance().waterLevel - 1.5f;
                initialized = true;
            }
Exemple #2
0
            void Start()
            {
                gameEntity      = gameObject.GetComponent <IGameEntity>() as IGameEntity;
                inputController = gameObject.GetComponent <IGameEntityInput>() as IGameEntityInput;

                terrainCollisionHandler = gameObject.GetComponent <ITerrainCollision>() as ITerrainCollision;
                if (terrainCollisionHandler != null)
                {
                    terrainCollisionHandler.Initialize();
                }

                characterController = GetComponent <CharacterController>();

                characterController.slopeLimit = slopeLimit;

                animationController = transform.GetComponentInChildren <DefaultAnimationController>();

                swimLevel   = Settings.Instance().waterLevel - 1.5f;
                initialized = true;
            }