コード例 #1
0
 // Use this for initialization
 void Start()
 {
     rootobj = transform.root.gameObject;
     //ui.SetActive(false);
     click   = false;
     _text   = buildpanel.transform.Find("name").gameObject.GetComponent <Text>();
     uistats = buildpanel.GetComponentInParent <UIStats>();
 }
コード例 #2
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);
        }
    }
コード例 #3
0
ファイル: UIManager.cs プロジェクト: Y0uka1/Diplom
 public void Initialize()
 {
     stats       = FindObjectOfType <UIStats>();
     feed        = FindObjectOfType <BattleFeed>();
     turnPointer = FindObjectOfType <TurnPointer>();
     healthBar   = GetComponent <HealthBarManager>();
     CommonUI    = GameObject.FindGameObjectWithTag("CommonUI");
     BattleUI    = GameObject.FindGameObjectWithTag("BattleUI");
     // feed.Initialize();
     // stats.Initialize();
     // turnPointer.Initialize();
     //healthBar.Initialize();
     BattleUI.SetActive(false);
     status = ManagerStatus.Online;
     Debug.Log("UI manager onine");
 }
コード例 #4
0
ファイル: UIStats.cs プロジェクト: deonix37/CreateYourFrisk
 private void Awake()
 {
     instance = this;
 }
コード例 #5
0
ファイル: UIStats.cs プロジェクト: spacecatprime/Unitale
 void Awake()
 {
     instance = this;
 }
コード例 #6
0
 void Awake()
 {
     sharedInstance = this;
 }
コード例 #7
0
ファイル: Player.cs プロジェクト: JesperBystrom/Portfolio
    public override void OnStartLocalPlayer()
    {
        if (!isLocalPlayer)
        {
            return;
        }
        commandManager = new CommandManager(this);
        for (int i = 0; i < prefabsToRegister.Length; i++)
        {
            ClientScene.RegisterPrefab(prefabsToRegister [i]);
        }
        ResourceStructure.initilize();

        /*
         * ClientScene.RegisterPrefab((GameObject)Resources.Load("Prefabs/Enemy"));
         * ClientScene.RegisterPrefab((GameObject)Resources.Load("Particles/Hit"));
         * ClientScene.RegisterPrefab((GameObject)Resources.Load("Particles/ImpactOnGround"));
         * ClientScene.RegisterPrefab(skillPrefab);
         * ClientScene.RegisterPrefab(skillEffectPrefab);*/
        //UI
        UICanvas      = GameObject.Find("UI");
        login         = Tools.findInactiveChild(UICanvas, "Login_UI").GetComponent <Login>();
        this.movement = GetComponent <PlayerMovement>();
        //skills
        this.skillUi = Tools.findInactiveChild(UICanvas, "Actionbar_UI").GetComponent <SkillUIManager>();
        this.skillUi.init(this);
        this.skillManager = GetComponent <SkillManager>();
        this.skillManager.init(this, getSkillUiManager());

        //this.skillTreeUi = GameObject.Find(this.skillTreeUi.name)

        //network
        network = GetComponent <playerNetwork>();
        network.initialize(this);

        this.skillTreeUi = Tools.getChild(UICanvas, this.skillTreeUi.name);

        //chat
        chat = Tools.getChild(UICanvas, "Chat_UI").GetComponent <Chat>();
        chat.setPlayer(this);

        //inventory
        this.inventory = this.GetComponent <Inventory> ();
        this.inventory.init(this);

        //equip
        equip = Tools.getChild(UICanvas, "Equipment_UI").GetComponent <EquipmentHandler>();
        equip.setEquipmentUI(Tools.getChild(UICanvas, "Equipment_UI"));
        equip.setPlayer(this);

        //camera
        camera = Camera.main;
        camera.GetComponent <MainCamera> ().player = this.gameObject;
        camera.GetComponent <MainCamera> ().setState((int)e_cameraStates.DEFAULT);

        //worlds
        worlds[0] = GameObject.Find("login_World");
        worlds[1] = GameObject.Find("World");


        //TempQuestUI
        GameObject tempQuestUI = Instantiate(this.quest_UI);

        this.questInformationData = tempQuestUI.GetComponentInChildren <QuestInformationData>();
        tempQuestUI.transform.SetParent(this.getUI().transform);
        tempQuestUI.transform.SetAsLastSibling();
        tempQuestUI.SetActive(false);
        questInformationObject = tempQuestUI;

        //QuestWrapper
        questWrapper = getUI().transform.GetChild(getUI().transform.childCount - 1).GetChild(1).GetChild(0).GetComponent <QuestWrapper>();

        //UIPlayer
        this.UIPlayer = Tools.findInactiveChild(UICanvas, "Footer_UI").GetComponent <UIPlayerHandler>();
        this.UIPlayer.setPlayer(this);
        this.UIPlayer.gameObject.SetActive(true);
        this.UIPlayer.updateInfo();

        this.UIActionBar = Tools.findInactiveChild(UICanvas, "Actionbar_UI");
        UIActionBar.SetActive(true);
        this.uiStats = Tools.findInactiveChild(UICanvas, "Stat_UI").GetComponent <UIStats>();
        uiStats.gameObject.SetActive(false);
        Debug.Log("STATS: " + this.stats.s_str);

        this.UIDeath = Tools.findInactiveChild(this.getUI(), "Death_UI");
        this.UIDeath.SetActive(true);
        this.UIDeath.GetComponent <GraveStone>().player = this;
        this.UIDeath.SetActive(false);

        //QuestManager
        this.npcController = GameObject.FindWithTag("NPCManager").GetComponent <NPCController>();
        npcController.initilize(this);

        identity = this.GetComponent <NetworkIdentity>();
        Debug.Log("INFO1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    }
コード例 #8
0
 public void increment(int str, int dex, int s_int, int watt, int matt, int health, int mana, int exp, int level, int money, UIStats uistats)
 {
     this.s_str  += str;
     this.s_dex  += dex;
     this.s_int  += s_int;
     this.s_watt += watt;
     this.s_matt += matt;
     this.health += health;
     this.mana   += mana;
     this.exp    += exp;
     this.level  += level;
     this.money  += money;
     uistats.update(this);
 }