chenxin
2020-11-20 09053388ef6d58a7de59fab450c11ee0affbceb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TowerDefense.Nodes;
 
/**
 * PVE 无尽模式切换基地
 * @Author: chenxin
 * @Date: 2020-10-15 10:18:39
 */
namespace KTGMGemClient
{
    public class EndlessSwitchHomeBase : MonoBehaviour
    {
        private FixedNodeSelector selector;
 
        /// <summary>
        /// 一排的基地数量
        /// </summary>
        private int homeBaseNum { get; set; } = 5;
 
        /// <summary>
        /// 所有基地
        /// </summary>
        public Node[] AllHomeBase;
 
        private void Start()
        {
            selector = GetComponent<FixedNodeSelector>();
        }
 
        /// <summary>
        /// 重置基地
        /// </summary>
        public void ResetHomeBase()
        {
            selector.linkedNodes[0] = AllHomeBase[0];
        }
 
        /// <summary>
        /// 切换基地
        /// </summary>
        public Node SwitchHomeBase()
        {
            selector.linkedNodes[0] = AllHomeBase[1];
 
            return selector.linkedNodes[0];
        }
    }
}