コード例 #1
0
 private void OnGUI()
 {
     if (GUILayout.Button("Start"))
     {
         BaseBattleInstance.Instance.Start();
     }
     if (GUILayout.Button("Goblin"))
     {
         FSGameObject gob = BaseBattleInstance.Instance.CreateGameObject("Goblin");
         gob.AddComponent <FSCharacterController>();
         gob.AddComponent <FSUnityController>();
         //spawn goblin
     }
     if (GUILayout.Button("boar knight"))
     {
         //spawn boar knight
     }
     if (GUILayout.Button("giant"))
     {
         //spawn giant
     }
     if (GUILayout.Button("fly dragon"))
     {
         //spawn fly dragon
     }
 }
コード例 #2
0
        public virtual FSGameObject CreateGameObject(string name)
        {
            if (gameObjectDictionary.ContainsKey(name))
            {
                Debug.LogError("already has game object" + name);
                return(null);
            }
            FSGameObject inst = new FSGameObject(name);

            gameObjectDictionary.Add(name, inst);
            return(inst);
        }
コード例 #3
0
 protected InternalBattleInstance()
 {
     FSGameObject.InitPrivateCall();
 }
コード例 #4
0
 public virtual void DestroyGameObject(FSGameObject gameObj)
 {
     gameObj.NeedDestroy = true;
 }