コード例 #1
0
 private void OnEnable()
 {
     if (Application.isPlaying)
     {
         return;
     }
     m_CreatureRoot = GetComponentInChildren <CreatureRoot>();
     m_LocationRoot = GetComponentInChildren <LocationRoot>();
     m_TeleportRoot = GetComponentInChildren <TeleportRoot>();
     m_LeapRoot     = GetComponentInChildren <LeapRoot>();
     m_TriggerRoot  = GetComponentInChildren <TriggerRoot>();
     m_TreasureRoot = GetComponentInChildren <TreasureRoot>();
     m_MineralRoot  = GetComponentInChildren <MineralRoot>();
     if (m_LeapRoot == null)
     {
         CreateLeapRoot();
     }
     if (m_TriggerRoot == null)
     {
         CreateTriggerRoot();
     }
     if (m_TreasureRoot == null)
     {
         CreateTreasureRoot();
     }
     if (m_MineralRoot == null)
     {
         CreateMineralRoot();
     }
 }
コード例 #2
0
        public void Init(TreasureRoot root)
        {
            if (root == null)
            {
                return;
            }

            m_Root = root;

            GamingMapArea gamingArea = root.m_GamingMapArea;

            if (gamingArea != null)
            {
                Area[] areas = FindObjectsOfType <Area>();
                if (areas != null && areas.Length > 0)
                {
                    for (int iArea = 0; iArea < areas.Length; iArea++)
                    {
                        Area area = areas[iArea];
                        if (area.Uid == gamingArea.m_AreaId)
                        {
                            m_Marks    = area.GetSemaphoreMarks();
                            m_RootMark = area.m_TreasureRoot;
                        }
                    }
                }
            }
        }
コード例 #3
0
 public static void OpenWindow(TreasureRoot root)
 {
     sm_TreasureWin          = GetWindow <TreasureInfoWindow>();
     sm_TreasureWin.position = new Rect(600, 300, 400, 400);
     sm_TreasureWin.minSize  = new Vector2(500, 500);
     sm_TreasureWin.Show();
     sm_TreasureWin.Init(root);
 }
コード例 #4
0
        private void CreateTreasureRoot()
        {
            GameObject treasureObj = new GameObject(typeof(TreasureRoot).Name);

            treasureObj.transform.SetParent(transform);
            treasureObj.transform.localPosition = Vector3.zero;
            treasureObj.transform.localScale    = Vector3.one;
            m_TreasureRoot = treasureObj.AddComponent <TreasureRoot>();
        }
コード例 #5
0
        private void OnEnable()
        {
            m_Target = target as TreasureRoot;
            GamingMapArea gamingArea = m_Target.m_GamingMapArea;

            if (gamingArea != null)
            {
                Area[] areas = FindObjectsOfType <Area>();
                if (areas != null && areas.Length > 0)
                {
                    for (int iArea = 0; iArea < areas.Length; iArea++)
                    {
                        Area area = areas[iArea];
                        if (area.Uid == gamingArea.m_AreaId)
                        {
                            marks = area.GetSemaphoreMarks();
                        }
                    }
                }
            }
        }