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;
            }
Esempio n. 2
0
 public bool isCollidingWith(ITerrainCollision terrain)
 {
     return terrain.getYValueFor(this.Position.X, this.Position.Z) >= (int) this.Position.Y;
 }