Beispiel #1
0
        // Use this for initialization
        void Start()
        {
            myRigidBody         = GetComponent <Rigidbody2D>();
            _playerSpellManager = FindObjectOfType <PlayerSpellManager>();
            spellDirection      = _playerSpellManager.SpellDirection;

            if (!String.IsNullOrEmpty(SpellSoundName))
            {
                _sFXManager = FindObjectOfType <SFXManager>();
                _sFXManager.PlaySound(SpellSoundName);
            }
        }
        // Use this for initialization
        void Start()
        {
            anim                = GetComponent <Animator>();
            myRigidBody         = GetComponent <Rigidbody2D>();
            sfxManager          = FindObjectOfType <SFXManager>();
            playerHealthManager = GetComponent <PlayerHealthManager>();
            playerManaManager   = GetComponent <PlayerManaManager>();
            playerSpellManager  = GetComponent <PlayerSpellManager>();

            direction = EnumsAndConstants.SpellDirection.None;

            if (!playerExists)
            {
                playerExists = true;
                DontDestroyOnLoad(transform.gameObject);
            }
            else
            {
                Destroy(gameObject);
            }
        }