Exemplo n.º 1
0
    void Start()
    {
        transform.Find("Turret/Camera").gameObject.SetActive(isPlayer);
        transform.Find("Minimap camera").gameObject.SetActive(isPlayer);
        transform.Find("HUD").gameObject.SetActive(isPlayer);
        transform.Find("Minimap object/Number").GetComponent <TextMesh> ().text        = (index + 1).ToString();
        transform.Find("Minimap object").GetComponent <MeshRenderer> ().material.color = (isPlayer) ? Color.green : Color.red;
        Color c = (isPlayer) ? new Color32(44, 55, 200, 1) : new Color32(200, 55, 44, 1);

        foreach (Transform o in transform.Find("Base/Colored"))
        {
            o.GetComponent <MeshRenderer> ().material.color = c;
        }
        transform.Find("Turret").GetComponent <MeshRenderer> ().material.color = c;

        if (isPlayer)
        {
            controller = gameObject.AddComponent <PlayerControllerScript> ();
        }
        else
        {
            controller = gameObject.AddComponent <EnemyControllerScript> ();
            controller.GetComponent <EnemyControllerScript> ().easy = StaticData.easy;
        }


        gc = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameControllerScript> ();

        tms = GetComponent <TankMovementScript> ();
        ss  = GetComponent <ShootScript> ();
    }