private void Awake()
 {
     iceland   = GetComponent <Iceland>();
     fillimage = transform.GetChild(1).GetComponent <Image>();
 }
Esempio n. 2
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Iceland obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Esempio n. 3
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Iceland obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Esempio n. 4
0
 public Iceland(Iceland.Market m) : this(NQuantLibcPINVOKE.new_Iceland__SWIG_0((int)m), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Esempio n. 5
0
    public void AttackManagerMulti()
    {
        Debug.Log("icelandIndex: " + iceLandIndex + " playerType: " + playerType);
        print(GameUtil.isAttackModeOn + " form " + GameUtil.selectedIceLand[0] + " on iceLandIndex " + iceLandIndex);

        if (SceneManager.GetActiveScene().name.Equals("MultiPlayerGamePlayScene"))
        {
            for (int i = 0; i < GameUtil.numberofselected; i++)
            {
                Iceland attack = GamePlayManagerMultiPlayer.inst.mainSpawnContainer.transform.GetChild(GameUtil.selectedIceLand[i]).gameObject.GetComponent <Iceland>();
                if (GameUtil.isAttackModeOn && GameUtil.selectedIceLand[0].ToString() != iceLandIndex.ToString() && attack.color == GameManager.Inst.MyColor)
                {
                    print("<Color><b> totalPlane ♥  </b></Color>>> " + GamePlayManagerMultiPlayer.inst.mainSpawnContainer.transform.GetChild(GameUtil.selectedIceLand[i]).gameObject.GetComponent <Iceland>().totalPlane);

                    Dictionary <string, string> pairs = new Dictionary <string, string>();
                    pairs.Add("isAttackModeOn", GameUtil.isAttackModeOn.ToString());
                    pairs.Add("selectedIceLand", GameUtil.selectedIceLand[i].ToString());
                    pairs.Add("iceLandIndex", iceLandIndex.ToString());
                    pairs.Add("totalPlane", GamePlayManagerMultiPlayer.inst.mainSpawnContainer.transform.GetChild(GameUtil.selectedIceLand[i]).gameObject.GetComponent <Iceland>().totalPlane.ToString());
                    pairs.Add("deviceId", SystemInfo.deviceUniqueIdentifier);
                    socketIOComponent.Emit("Attack", new JSONObject(pairs));
                }
            }
        }

        if (color == GameManager.Inst.MyColor)
        {
            if (GameUtil.CheckIsIcelandSelected(iceLandIndex))
            {
                Multiplayerrest();
                //this.transform.GetChild(1).gameObject.SetActive(false);
                //GameUtil.ResetAttackMode();
            }
            else
            {
                string selectedPlayerType = GameUtil.GetIcelandValueUsingKey <string>(this.transform.parent.gameObject, GameUtil.selectedIceLand[0], "playerType");
                Debug.Log("selected iceland type: " + selectedPlayerType);

                if (selectedPlayerType == playerType && GameUtil.isAttackModeOn)
                {
                    if (GameUtil.isAttackModeOn)
                    {
                        GameUtil.attackIcelandIndex = iceLandIndex;
                        //reset timer if attacked on anyone
                        timeNotAttacked = 0;
                    }
                }
                else
                {
                    //this.transform.GetChild(1).gameObject.SetActive(true);
                    //GameUtil.selectedIceLand = new int[20];

                    //GameUtil.selectedIceLand[0] = iceLandIndex;
                    print("-=-=-=->Attack3333333-=-=->" + gameObject.name);
                    this.transform.GetChild(1).gameObject.SetActive(true);
                    this.transform.GetChild(1).gameObject.GetComponent <Image>().fillAmount = 1;
                    // GameUtil.selectedIceLand = new int[20];

                    GameUtil.numberofselected++;
                    GameUtil.selectedIceLand[GameUtil.numberofselected - 1] = iceLandIndex;

                    Debug.Log("Iceland selection " + GameUtil.selectedIceLand[0] + GameUtil.selectedIceLand.Length);

                    GameUtil.isAttackModeOn = true;
                }
            }
        }
        else /*if (playerType == "computer")*/
        {
            if (GameUtil.isAttackModeOn)
            {
                GameUtil.attackIcelandIndex = iceLandIndex;

                //reset timer if attacked on anyone
                timeNotAttacked = 0;
            }
        }
    }