public override void OnDoubleClick(Mobile from)
 {
     if (!(dclicked))
     {
         from.Frozen = true;
         Timer timer = new BuildTimer(from, this);
         timer.Start();
     }
     else
     {
         base.OnDoubleClick(from);
     }
 }
Example #2
0
 public static void PlayerReadyTrigger(int player, bool ready)
 {
     _playersReady[player - 1] = ready;
     if (_playersReady[0] == true && _playersReady[1] == true)
     {
         GetSetBuildPoints(false);
         SceneManager.LoadScene("Infinitrack");
     }
     else
     {
         BuildTimer.StartTimer(inst.BuildTimeAfterReady);
     }
 }
Example #3
0
    void onBuyBut(GameObject go)
    {
        GlobalVar.GetInstance().BuildTime = m_MyBB[Ind].UpgradeTime;
        if (GlobalVar.GetInstance().BuildQueues == 0)
        {
            //现有资源数量
            int Item0 = Convert.ToInt32(m_ResList[0].GetComponentInChildren<UILabel>().text);
            int Item1 = Convert.ToInt32(m_ResList[m_MyBB[Ind].NeedID1].GetComponentInChildren<UILabel>().text);
            int Item2 = Convert.ToInt32(m_ResList[m_MyBB[Ind].NeedID2].GetComponentInChildren<UILabel>().text);
            int Item3 = Convert.ToInt32(m_ResList[m_MyBB[Ind].NeedID3].GetComponentInChildren<UILabel>().text);

            if (m_MyBB[Ind].Cost < Item0 && m_MyBB[Ind].Count1 < Item1 && m_MyBB[Ind].Count2 < Item2 && m_MyBB[Ind].Count3 < Item3)
            {
                m_ResList[0].GetComponentInChildren<UILabel>().text = (Item0 - m_MyBB[Ind].Cost).ToString();
                m_ResList[m_MyBB[Ind].NeedID1].GetComponentInChildren<UILabel>().text = (Item1 - m_MyBB[Ind].Count1).ToString();
                m_ResList[m_MyBB[Ind].NeedID2].GetComponentInChildren<UILabel>().text = (Item2 - m_MyBB[Ind].Count2).ToString();
                m_ResList[m_MyBB[Ind].NeedID3].GetComponentInChildren<UILabel>().text = (Item3 - m_MyBB[Ind].Count3).ToString();

                //保值
                GlobalVar.GetInstance().BuildStartTime = DateTime.Now;
                GlobalVar.GetInstance().BuildID = Convert.ToInt32(m_BId.GetComponent<UILabel>().text);

                GlobalVar.GetInstance().BuildQueues = 1;           

                m_HouseMenu.SetActive(false);
                m_CameraMap.GetComponent<CameraDragMove>().enabled = true;
                m_CameraMap.GetComponent<ScalingMap>().enabled = true;
                

                BuildTimer UI = new BuildTimer(GlobalVar.GetInstance().BuildObjname); //派遣建造队
            }
            else
            {
                string str = "岛主,金币不足目前无法对目标建筑进行升级!!";
                warning warning = new warning(str);
            }
        }
        else
        {
            string Str = "岛主,当前没有闲置的建造队,所以无法进行装修!";
            warning Warning = new warning(Str);
        }

    }
Example #4
0
    void CheckActivities()
    {
        foreach (var activity in allProcessingActivies)
        {
            switch (activity.Value.activityType)
            {
            case ActivityType.Quest:
            {
                GameObject ActivityTimerGO = new GameObject(activity.Value.activityID.ToString());
                ActivityTimerGO.transform.SetParent(transform.Find("ActivitiesList"));
                ClockTimer questTimer = ActivityTimerGO.AddComponent <ClockTimer>();
                questTimer.activityInformation = activity.Value;
                break;
            }

            case ActivityType.Craft:
            {
                GameObject ActivityTimerGO = new GameObject(activity.Value.activityID.ToString());
                ActivityTimerGO.transform.SetParent(transform.Find("ActivitiesList"));
                PointTimer craftTimer = ActivityTimerGO.AddComponent <PointTimer>();
                craftTimer.activityInformation = (activity.Value);
                break;
            }

            case ActivityType.Build:
            {
                Builder builder = BuildingManager.Instance.AllBuildings.SingleOrDefault(b => b.ID == activity.Value.informationID);

                BuildTimer buildTimer = builder.representGameObject.GetComponent <BuildTimer>();
                if (buildTimer)
                {
                    buildTimer.activityInformation = activity.Value;
                    buildTimer.UpdateNewFinishTime();
                }
                break;
            }

            case ActivityType.Pregnancy:
            {
                GameObject ActivityTimerGO = new GameObject(activity.Value.activityID.ToString());
                ActivityTimerGO.transform.SetParent(NotificationManager.Instance.gameObject.transform.Find("ActivitiesList"));
                ClockTimer questTimer = ActivityTimerGO.AddComponent <ClockTimer>();
                questTimer.activityInformation = activity.Value;

                break;
            }

            case ActivityType.CharacterGrowing:
            {
                GameObject ActivityTimerGO = new GameObject(activity.Value.activityID.ToString());
                ActivityTimerGO.transform.SetParent(NotificationManager.Instance.gameObject.transform.Find("ActivitiesList"));
                ClockTimer questTimer = ActivityTimerGO.AddComponent <ClockTimer>();
                questTimer.activityInformation = activity.Value;

                break;
            }

            default:
            {
                Debug.LogWarning($"{activity.Value.activityType} is currently unhandled.");
                break;
            }
            }
        }
    }
Example #5
0
 private void Awake()
 {
     instance = this;
 }