Example #1
0
        private void Awake()
        {
            DontDestroyOnLoad(this);
            if (FindObjectsOfType(GetType()).Length > 1)
            {
                Destroy(gameObject);
            }

            _translation = new CharacterTranslation(this);
            _rotation    = new CharacterRotation(this);
            _interaction = new CharacterInteraction(this);

            Health    = 50f;
            Speed     = 4f;
            JumpForce = 5f;
            Points    = 0;

            _damageable = true;

            SetStats();
        }
Example #2
0
        private void FixedUpdate()
        {
            if (_interaction == null)
            {
                _interaction = new CharacterInteraction(this);
            }

            if (Health <= 0)
            {
                SceneManager.LoadScene(4);
            }

            if (Input.GetKeyDown("b"))
            {
                var loc = GameManager.Instance.Character.transform.position;
                Instantiate(BreadcrumbPrefab, loc, transform.rotation);
            }

            _translation.Update();
            _rotation.Update();
            _interaction.Update();
        }
Example #3
0
 private void Start()
 {
     _characterController  = GetComponent <CharacterController>();
     _characterInteraction = GetComponent <CharacterInteraction>();
 }