コード例 #1
0
        public override void OnInspectorGUI()
        {
            raceSet = (RaceSet)target;


            if (GUILayout.Button("进入编辑模式") && AidNode == null)
            {
                AidNode = new GameObject("Aid Node", typeof(LineRenderer));
                AidNode.GetComponent <LineRenderer>().positionCount = raceSet.raceNodes.Length;

                AidNode.GetComponent <LineRenderer>().SetPositions(raceSet.raceNodes);
                IconManager.SetIcon(AidNode, IconManager.LabelIcon.Orange);
                LockEditor();
            }

            if (AidNode)
            {
                if (GUILayout.Button("关闭编辑模式"))
                {
                    DestroyImmediate(AidNode);
                    UnlockEditor();
                }
            }


            base.OnInspectorGUI();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
コード例 #2
0
 public RaceSet(RaceSet other) : this(bwapiPINVOKE.new_RaceSet__SWIG_1(RaceSet.getCPtr(other)), true)
 {
     if (bwapiPINVOKE.SWIGPendingException.Pending)
     {
         throw bwapiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #3
0
 public RaceSetEnumerator(RaceSet collection)
 {
     collectionRef = collection;
     keyCollection = new global::System.Collections.Generic.List <Race>(collection.Values);
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
コード例 #4
0
    public void StartRace(System.Action onRaceOver)
    {
        raceSet = Instantiate(Resources.Load <RaceSet>("Modules/DesertRace"));

        CheckPoint = Instantiate(Resources.Load <Transform>("Modules/CheckPoint"));

        raceTimeMesh = CheckPoint.Find("Time").GetComponent <TextMesh>();

        for (int i = 0; i < raceSet.raceNodes.Length; i++)
        {
            nodes.Enqueue(raceSet.raceNodes[i]);
        }

        t = 0;

        StartCoroutine(RacelogicLoop(onRaceOver));
    }
コード例 #5
0
 public void SetRace(RaceEnum race)
 {
     Race = Enum.GetName(typeof(RaceEnum), race);
     RaceSet?.Invoke(race);
 }
コード例 #6
0
 public static RaceSet allRaces() {
   RaceSet ret = new RaceSet(bwapiPINVOKE.allRaces(), false);
   return ret;
 }
コード例 #7
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RaceSet obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }