Ejemplo n.º 1
0
    public void init(GameObject target,int pNum)
    {
        forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
        myOb = target;
        playerNum = forNext.playerNum;
        control_bar = new GameObject[playerNum + 1];
        ghostB = target.GetComponent<ghost_base> ();

        for (int i=0; i<=playerNum; i++) {
            control_bar [i] = Instantiate (control_barOb);
            RectTransform rt = control_bar [i].GetComponent<RectTransform> ();
            if (i == playerNum) {
                rt.pivot = new Vector2 (1f, 0.5f);
                rt.anchoredPosition = Vector2.right * rt.sizeDelta.x / 2;
                transform.SetAsFirstSibling();
            } else {
                control_bar [i].GetComponent<Image> ().color = ghostB.domiColor[i];
                rt.anchoredPosition = Vector2.left * rt.sizeDelta.x / 2;
            }
            control_bar [i].transform.SetParent (transform);
        }
        control_bar [pNum].transform.SetAsLastSibling ();
        control_bar [playerNum].transform.SetAsFirstSibling ();
        canShow = false;
        barLength = control_bar [playerNum].GetComponent<RectTransform> ().sizeDelta.x;
        LenUnit = barLength / 100;
        cando = true;
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Awake()
 {
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     forNext.SetFlag(PhotonNetwork.player.ID,0);
     gameInfo = GameObject.Find ("GameMaster").GetComponent<GameInfo> ();
     ghostList = GameObject.Find ("GhostList");
     myEnd = true;
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     organC = GameObject.FindWithTag (forNext.myid.ToString()+"P_Master").GetComponent<organ_controller> ();
     cursorC = GameObject.Find ("Organ/Map/Organ_Cursor").GetComponent<cursor_controller> ();
     cursorRt = GameObject.Find ("Organ/Map/Organ_Cursor").GetComponent<RectTransform> ();
     myColor = GetComponent<Image> ();
     transform.SetSiblingIndex (0);
     domiColorList = Resources.LoadAll<Sprite>("G");
     neutralColor = Resources.Load<Sprite> ("GH");
 }
Ejemplo n.º 4
0
 IEnumerator WaitInit()
 {
     commons common = GameObject.FindWithTag ("commons").GetComponent<commons> ();
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     while (!common.myOk) {
         yield return 0;
     }
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     myPlayer = GameObject.FindWithTag (forNext.myid+"P_Master");
     pcon = myPlayer.GetComponent<PlayerController> ();
     myHP = transform.FindChild ("Player_HP").GetComponent<RectTransform> ();
     myTP = transform.FindChild ("Player_TP").GetComponent<RectTransform> ();
     myHPText = transform.FindChild ("Player_HP_Text");
     HPLenUnit = myHP.sizeDelta.x / 500f;
     TPLenUnit = myHP.sizeDelta.x / 100f;
     cando = true;
 }
Ejemplo n.º 5
0
 public void init(GameObject nicon, int num=-100)
 {
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     myOb = nicon;
     myObC = nicon.GetComponent<Sava_controler> ();
     rt = GetComponent<RectTransform> ();
     offset.x = ((nicon.transform.position.x - 250f) * 3f) / 5f;
     offset.y = ((nicon.transform.position.z - 250f) * 3f) / 5f;
     rt.anchoredPosition = offset;
     if (num != -100)
         myGroupNum = num;
     cursor = GameObject.Find ("Organ_Cursor");
     cursorC = cursor.GetComponent<cursor_controller> ();
     cursorRt = cursor.GetComponent<RectTransform> ();
     mycolor = gameObject.GetComponent<Image> ();
     myorgan = GameObject.FindWithTag (forNext.myid.ToString()+"P_Master").GetComponent<organ_controller> ();
     cando = true;
 }
Ejemplo n.º 6
0
 IEnumerator WaitInit()
 {
     commons common = GameObject.FindWithTag ("commons").GetComponent<commons> ();
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     while (!common.myOk) {
         yield return 0;
     }
     myParent = GameObject.Find ("Organ/Map");
     transform.SetParent (myParent.transform);
     cursor = GameObject.Find ("Organ_Cursor");
     cursorC = cursor.GetComponent<cursor_controller> ();
     cursorRt = cursor.GetComponent<RectTransform> ();
     cando = true;
 }
Ejemplo n.º 7
0
 IEnumerator WaitInit()
 {
     commons common = GameObject.FindWithTag ("commons").GetComponent<commons> ();
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     while (!common.myOk) {
         yield return 0;
     }
     player = GameObject.FindWithTag (forNext.myid.ToString()+"P_Master");
     organC = player.GetComponent<organ_controller> ();
     cando = true;
 }
Ejemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        rt = GetComponent<RectTransform> ();
        forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
        StartCoroutine (WaitInit ());
        //player = GameObject.FindWithTag (forNext.myid.ToString()+"P_Master");
        //organC = player.GetComponent<organ_controller> ();

        MBdestT = transform.FindChild ("Message_dest/Text").GetComponent<Text> ();
        MBdest = transform.FindChild ("Message_dest").GetComponent<Image> ();
        MBcancel = transform.FindChild ("Message_cancel").GetComponent<Image> ();
        MBcancelT = transform.FindChild ("Message_cancel/Text").GetComponent<Text> ();
        MBmarch = transform.FindChild ("Message_marching").GetComponent<Image> ();
        MBmarchT = transform.FindChild ("Message_marching/Text").GetComponent<Text> ();
        MBmarchI = transform.FindChild ("Message_marching/Image").GetComponent<Image> ();
        MBisMarch = transform.FindChild ("Message_isMarching").GetComponent<Image> ();
        MBisMarchT = transform.FindChild ("Message_isMarching/Text").GetComponent<Text> ();
        MBisMarchI = transform.FindChild ("Message_isMarching/Image").GetComponent<Image> ();
        MBmove = transform.FindChild ("Message_move").GetComponent<Image> ();
        MBmoveT = transform.FindChild ("Message_move/Text").GetComponent<Text> ();
        MBmoveI = transform.FindChild ("Message_move/Image").GetComponent<Image> ();
        MBisMove = transform.FindChild ("Message_isMove").GetComponent<Image> ();
        MBisMoveT = transform.FindChild ("Message_isMove/Text").GetComponent<Text> ();
        MBisMoveI = transform.FindChild ("Message_isMove/Image").GetComponent<Image> ();
        MBgroup = transform.FindChild ("Message_grouping").GetComponent<Image> ();
        MBgroupT = transform.FindChild ("Message_grouping/Text").GetComponent<Text> ();
        MBgroupI = transform.FindChild ("Message_grouping/Image").GetComponent<Image> ();
        MBisgroup = transform.FindChild ("Message_isGrouping").GetComponent<Image> ();
        MBisgroupT = transform.FindChild ("Message_isGrouping/Text").GetComponent<Text> ();
        MBisgroupI = transform.FindChild ("Message_isGrouping/Image").GetComponent<Image> ();

        mapSize = 150;

        offset = rt.anchoredPosition;
        tox = 0f;
        toy = 0f;
        forcef = 1.5f;
        moveH = 0f;
        moveV = 0f;
        targetG = 0;
    }
Ejemplo n.º 9
0
 void Awake()
 {
     myParent = GameObject.Find("PlayerList");
     transform.SetParent (myParent.transform);
     if (photonView.isMine) {
         myCamera = GameObject.Find ("MainCamera").GetComponent<CameraController> ();
         myCamera.Init (gameObject);
     }
     gameInfo = GameObject.Find ("GameMaster").GetComponent<GameInfo> ();
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     myNum = forNext.ownerIdToNum [photonView.ownerId];
     //myNum = forNext.myid;
     myColor = gameInfo.myColor;
     nowHP = maxHP;
     nowTP = maxTP / 2;
     tag = forNext.ownerIdToNum[photonView.ownerId].ToString()+"P_Master";
     if (!photonView.isMine) {
         myHead = Instantiate(Resources.Load("Master_HP_TP")) as GameObject;
         myHead.GetComponent<master_head_HPTP>().init(gameObject,myColor);
         myHead.transform.SetParent(GameObject.Find("Minimap").transform);
     }
     miniMe = Instantiate(Resources.Load("minimap/Mini_master")) as GameObject;
     miniMe.GetComponent<mini_master> ().init (gameObject, myColor);
     organMe = Instantiate (Resources.Load ("Map_master")) as GameObject;
     organMe.GetComponent<organ_master> ().init (gameObject,colorNum);
 }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     agent = GetComponent<NavMeshAgent> ();
     anim = GetComponent<Animator> ();
     minimap = GameObject.Find ("Minimap");
     toSubmission = GameObject.Find ("Player_info/Sava_report").GetComponent<sava_report> ();
     canReport = true;
     HP = maxHP;
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     gameInfo = GameObject.Find ("GameMaster").GetComponent<GameInfo> ();
     myNum = forNext.ownerIdToNum [photonView.ownerId];
     tag = myNum.ToString () + "P_Sava";
     myColor = gameInfo.myColor;
     MakeHeadHP ();
     repoFight = repoRearch = repoSituation = true;
 }
Ejemplo n.º 11
0
 public void init(GameObject Mi, GameObject MMi, GameObject SS, int gnum, bool le, int myNumm)
 {
     mapIcon = Mi;
     mMapIcon = MMi;
     sideHP = SS;
     myGroupNum = gnum;
     leader = le;
     myTeamNum = myNumm;
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     gameObject.tag = forNext.ownerIdToNum [photonView.ownerId].ToString () + "P_Sava";
 }
Ejemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     myNum = forNext.myid;
     offset = rt.anchoredPosition;
 }
Ejemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        transform.parent.SetParent (GameObject.Find ("Players").transform);
        buttons = GetComponent<Button> ();
        myFace = GetComponent<Image> ();
        charNum = charFace.Length;
        cam1 = transform.FindChild ("Cam").gameObject;
        myColor = transform.FindChild ("Color").GetComponent<Image> ();
        myTeam = transform.FindChild ("Team").GetComponent<Image> ();
        gameInfo = GameObject.Find ("GameMaster").GetComponent<GameInfo> ();
        rt = GetComponent<RectTransform> ();
        rt.anchoredPosition = new Vector2 (-180 + (photonView.ownerId - 1) * 360, 65);
        cam1.GetComponent<Camera> ().rect = new Rect (0.07f + (photonView.ownerId - 1) * 0.5f, 0, 0.3f, 0.5f);
        for (int i = 0; i < charNum; i++) {
            charactors [i] = Instantiate (charactors [i], new Vector3 (i * 30, 50 * photonView.ownerId, 0), Quaternion.identity) as GameObject;
        }

        forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
        DontDestroyOnLoad (forNext);

        myColor.color = forNext.Colors [seleC];
        SetCamPos ();
    }
Ejemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        myParent = GameObject.Find ("GhostList");
        transform.SetParent (myParent.transform);
        forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
        gameInfo = GameObject.Find ("GameMaster").GetComponent<GameInfo> ();
        playerNum = forNext.playerNum;
        domiColor = new Color[playerNum];
        /*
        PhotonPlayer[] player = PhotonNetwork.playerList;
        foreach (PhotonPlayer pPlayer in player) {
            domiColor[] [pPlayer.ID])
                return false;
        }
        for (int i = 0; i<playerNum; i++)
            domiColor [i] = forNext.Colors[forNext.playerInfo [i].colorNum];
        */
        ghostHP = Instantiate (ghostHP_ob);
        ghostHP.GetComponent<ghost_control> ().init (gameObject, forNext.ownerIdToNum [photonView.ownerId]);
        ghostHP.transform.SetParent (GameObject.Find ("Minimap").transform);

        myPV = photonView;
        power = new int[playerNum + 1];
        power [playerNum] = 100;

        right = transform.FindChild ("Light").GetComponent<ParticleSystem> ();
        offset.x = ((transform.position.x - 250f) * 3f) / 5f;
        offset.y = ((transform.position.z - 250f) * 3f) / 5f;

        ghostC = ghostHP.GetComponent<ghost_control> ();
        right.enableEmission = false;

        mapicon = Instantiate (mapicon_ob, offset, Quaternion.identity) as GameObject;
        mapicon.transform.SetParent (GameObject.Find ("Map").transform);
        myNum = forNext.getGNum ();
        mapicon.GetComponent<ghost_icon> ().init (myNum, offset, this);
        dominator = -1;
    }
Ejemplo n.º 15
0
 IEnumerator WaitInit()
 {
     commons common = GameObject.FindWithTag ("commons").GetComponent<commons> ();
     forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
     while (!common.myOk) {
         yield return 0;
     }
     MG = GameObject.FindGameObjectWithTag (forNext.myid.ToString()+"P_MG").GetComponent<MG_func> ();
     organ = GameObject.FindWithTag (forNext.myid.ToString()+ "P_Master").GetComponent<organ_controller> ();
     rt.anchoredPosition = init_pos;
     cando = true;
 }
Ejemplo n.º 16
0
    // Use this for initialization
    void Start()
    {
        forNext = GameObject.Find ("ForNextScene").GetComponent<For_next> ();
        entrys = transform.FindChild ("Entry_list");
        entry_num = entrys.childCount;
        rt = transform.FindChild ("Menu_selector").GetComponent<RectTransform> ();

        myselector = transform.FindChild ("Menu_selector").GetComponent<Image> ();
        Mana = GameObject.Find ("Mana").GetComponent<Mana_manager> ();
        init_pos = new Vector2 (0f, -20f);
        rt.anchoredPosition = init_pos;

        updown = 21f;
        point = 0;

        entry_list = new Transform [entry_num];
        int count = 0;
        foreach (Transform child in entrys) {
            child.GetComponent<RectTransform> ().anchoredPosition = init_pos;
            init_pos.y -= 21f;
            entry_list [count] = child;
            count++;

        }
        init_pos = new Vector2 (0f, -20f);
        init_pos = new Vector2 (0f, -100f);
        rt.position = init_pos;
        savaGroupNum = 1;
        coflag = false;
        cantReleasing = false;
        StartCoroutine (WaitInit ());
    }