예제 #1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            Destroy(this);
        }

        sc = gameObject.GetComponent <PlayerSpriteController>();

        maincamera       = FindObjectOfType <Camera>();
        playerAnimator   = GetComponent <Animator>();
        curScene         = SceneManagement.GetCurrentSceneName();
        weaponDictionary = ResourceManagement.SetUpWeaponDictionay("ScriptableObjects/Items/Equipable/Weapon");
        // CheckIfEquippedWeapon();



        switch (curScene)
        {
        case "CharacterCustomization":
            transform.position             = new Vector3(-5f, -1.5f, 0);
            SceneManagement.GameSceneLoad += PlayerBorn;
            break;

        case "GameScene":
            PlayerBorn();
            break;

        default:
            Debug.LogError("No default scene");
            break;
        }
    }