Exemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        Input.backButtonLeavesApp = true;
        self        = this;
        colorMap[0] = Color.green;
        colorMap[1] = Color.blue;
        colorMap[2] = new Color(0f, 1f, 1f);
        colorMap[3] = Color.black;
        colorMap[4] = Color.red;
        colorMap[5] = new Color(1f, 0f, 1f);
        colorMap[6] = new Color(1f, 1f, 0f);
        Mesh tileMesh = TilePrefab.GetComponent <MeshFilter>().sharedMesh;

        baseMainVerts = tileMesh.vertices;
        convertToSides(tileMesh, baseMainVerts, ref sideVerts);
        tileMesh.vertices = baseMainVerts;
        sideView          = false;
        inventory         = new Inventory(GameObject.FindGameObjectWithTag("inventory"), false);
        equipment         = new Inventory(GameObject.FindGameObjectWithTag("equipS"), true);

        myCam   = GameObject.FindGameObjectWithTag("Cam2").GetComponent <Camera> ();
        mainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> ();

        soundUI    = myCam.transform.GetChild(1).GetComponent <AudioSource> ();
        soundEquip = myCam.transform.GetChild(2).GetComponent <AudioSource> ();

        playerLocation = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> ();
        //playerAnim = playerLocation.GetComponent<Animator> ();
        //playerFollowL = GameObject.FindGameObjectWithTag ("PlayerFollow").GetComponent<Transform> ();
        UIInventory.SetActive(false);
        UINormal.SetActive(false);
        UIEdit.SetActive(false);
        UIMove.SetActive(false);
        UIChat.SetActive(false);
        UIStats.SetActive(false);
        UIHaS.SetActive(false);
        UICompass.SetActive(false);
        UIOptions.SetActive(false);
        chCam         = chatCam.GetComponent <Camera> ();
        chCam.enabled = false;
        //chatCam.SetActive (false);
        selBox  = GameObject.FindGameObjectWithTag("selectBox");
        selCirc = GameObject.FindGameObjectWithTag("selectCircle");
        selBox.SetActive(false);
        selCirc.SetActive(false);
        selectBox = selBox;
        foreach (EnemyType type in Enum.GetValues(EnemyType.archer.GetType()))
        {
            GameObject prefab = Resources.Load <GameObject>("Prefabs/enemy/" + type.ToString());
            enemyPrefabs.Add(type, prefab);
        }
    }