public void CustomizeAccepted()
    {
                #if UNITY_EDITOR
        //animUtils = GetComponent<AnimationCreaterUtils>();
        //animUtils.CreateSprite("back/back_place","back2_both_quiver","sprite/items/back/male/quiver");
                #endif
        PlayerController.playerExists = true;
        UIManager.UIexist             = true;

        DontDestroyOnLoad(playerObject);
        DontDestroyOnLoad(uiObject);

        thePlayer.activeScene = mainGameScen;

        menuScript.isGameRun = true;
        //var clone = FindObjectOfType<CameraControler>();
        //clone.GetComponent<Camera>().orthographicSize = 5.0f;
        //clone.offset = new Vector2(0,0);
        theCamera = FindObjectOfType <CameraControler>();
        theCamera.GetComponent <Camera>().orthographicSize = 5.0f;
        theCamera.offset = new Vector2(0, 0);

        //thePlayer.joyAction.gameObject.SetActive(true);
        thePlayer.joyAttack.gameObject.SetActive(true);
        thePlayer.joySpell.gameObject.SetActive(true);
        hpSlider.gameObject.SetActive(true);

        theLoadingScript.loading.SetActive(true);
        StartCoroutine(theLoadingScript.LoadLevelWithBar(mainGameScen));
        //SceneManager.LoadScene(mainGameScen);
    }
示例#2
0
    public void StartGame()
    {
        //find old player and destroy

        thePlayer = GameObject.FindGameObjectWithTag("Player");
        if (thePlayer != null)
        {
            Destroy(thePlayer);
        }
        //find old UIcanvas and destroy
        theUI = GameObject.FindGameObjectWithTag("UItag");
        if (theUI != null)
        {
            Destroy(theUI);
        }

        isGameRun = true;
        isMenuRun = false;

        //var clone1 = FindObjectOfType<CameraControler>();
        //clone1.GetComponent<Camera>().orthographicSize = 2.0f;
        //clone1.offset = new Vector2(0.77f,-0.33f);

        theLoadingScript.loading.SetActive(true);
        StartCoroutine(theLoadingScript.LoadLevelWithBar(mainGameScen));
    }
示例#3
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.name == "player")
        {
            //var clone = other.GetComponentInParent<snowEffect>();
            if (other.GetComponent <PlayerController>().playerDie == false)
            {
                //diasable effect
                var theObject = GameObject.Find("Snow(Clone)");
                if (theObject != null)
                {
                    Destroy(theObject);
                }
                other.GetComponent <PlayerController>().joyAction.gameObject.SetActive(false);
                other.GetComponent <PlayerController>().startPoint = exitPoint;

                other.GetComponent <PlayerController>().activeScene = leveToLoad;

                theLoadingScript.loading.SetActive(true);
                StartCoroutine(theLoadingScript.LoadLevelWithBar(leveToLoad));
                //SceneManager.LoadScene(leveToLoad, LoadSceneMode.Single);
            }
        }
    }