Exemplo n.º 1
0
    /******************** Utility ********************/

    void InitPlayerSettings()
    {
        foreach (InputDevice id in InputManager.Devices)
        {
            if (id.Meta == input.Meta)
            {
                input = id;
                print("What's going on");
            }
        }

        // Init Player Settings
        sprend.sprite = charSettings.GetSprite();
        animator.runtimeAnimatorController = charSettings.GetAnimator();
        projectilePrefab = charSettings.GetProjectile();
        ufo_manager.GetComponent <UFOManager>().UFOLakitu = charSettings.GetUFOManager();
        offscreen_arrow_manager.arrowPrefab         = charSettings.GetOffscreenIndicator();
        GetComponent <LocationArrow> ().arrowPrefab = charSettings.GetLocationArrow();

        // Init Team Settings
        teamNum          = teamSettings.teamNum;
        placementMask    = teamSettings.GetPlacementMask();
        platformsMask    = teamSettings.GetPlatformsMask();
        gameObject.layer = LayerMask.NameToLayer("Team" + teamNum + "Player");
        jetpackObj.transform.Find("Sprite").GetComponent <SpriteRenderer>().sprite = teamSettings.GetJetpack();
        aimSprend.sprite = teamSettings.GetWeapon();
        if (teamNum == 1)
        {
            point_manager.ui_pts_left = GameObject.Find("Team1Points").GetComponent <UnityEngine.UI.Text> ();
        }
        else
        {
            point_manager.ui_pts_left = GameObject.Find("Team2Points").GetComponent <UnityEngine.UI.Text> ();
        }
    }