public GamePullController() { if (id == null) { id = new Dictionary <string, int> (); } history = new Dictionary <GameObject, Actions.VoidGameObject> (); PullController.Create(); if (preorders == null) { preorders = new Dictionary <string, KeyValuePair <Actions.GameObjectVoid, Actions.VoidGameObject> > (); preoderNameTranslates = new Dictionary <string, string> (); preoderNameTranslates.Add("GUIButton", "GUIImage"); preoderNameTranslates.Add("GUIImageAlphaExpensive", "GUIImageAlpha"); preoderNameTranslates.Add("GUIButtonAlpha", "GUIImageAlpha"); preorders.Add("GUIImageAlpha", new KeyValuePair <Actions.GameObjectVoid, Actions.VoidGameObject> (CreateImageAlpha, DestroyImageAlpha)); preorders.Add("GUIImage", new KeyValuePair <Actions.GameObjectVoid, Actions.VoidGameObject> (CreateImage, DestroyImage)); preorders.Add("Audio", new KeyValuePair <Actions.GameObjectVoid, Actions.VoidGameObject> (CreateAudio, DestroyAudio)); preorders.Add("Text", new KeyValuePair <Actions.GameObjectVoid, Actions.VoidGameObject> (CreateText, DestroyText)); } }
void Awake() { rb = GetComponent <Rigidbody>(); col = GetComponent <Collider>(); bulletManager = GetComponent <BulletManager>(); pullController = GetComponent <PullController>(); state = HumanState.Idle; }
public static void DestroyBlock(GameObject gameObject) { if (gameObject.GetComponent <Rigidbody> ()) { GameObject.Destroy(gameObject.GetComponent <Rigidbody> ()); } PullController.AddObject("Block", gameObject); history.Remove(gameObject); }
public static void DestroyText(GameObject gameObject) { if (gameObject == null) { return; } PullController.AddObject("TextUndestroyable", gameObject); history.Remove(gameObject); }
public void EngineStop() { PullController.Stop(); Stuck.Stop(); Navigator.Stop(); Navigation = null; Navigator = null; _states = null; CombatHandler.CombatStatusChanged -= CombatChanged; GC.Collect(); }
public static GameObject CreateBlock() { tempGameObject = PullController.GetObject("Block"); if (tempGameObject == null) { tempGameObject = GameObject.Instantiate(ResourcesController.Load("Prefabs/Block")) as GameObject; } tempGameObject.name = "Block" + GetId("Block"); AddToHistory(tempGameObject, DestroyBlock); return(tempGameObject); }
public static GameObject CreateAudio() { tempGameObject = PullController.GetObject("AudioUndestroyable"); if (tempGameObject == null) { tempGameObject = GameObject.Instantiate(ResourcesController.Load("Prefabs/Audio")) as GameObject; } tempGameObject.name = "Audio" + GetId("AudioUndestroyable"); return(tempGameObject); }
public static GameObject CreateText() { tempGameObject = PullController.GetObject("TextUndestroyable"); if (tempGameObject == null) { tempGameObject = GameObject.Instantiate(ResourcesController.Load("Prefabs/GUI/TextMeshObject")) as GameObject; } tempGameObject.name = "Text" + GetId("TextUndestroyable"); AddToHistory(tempGameObject, DestroyText); return(tempGameObject); }
public static GameObject CreateImage() { tempGameObject = PullController.GetObject("GUIImageUndestroyable"); if (tempGameObject == null) { tempGameObject = GameObject.Instantiate(ResourcesController.Load("Prefabs/GUI/GUIObject")) as GameObject; } tempGameObject.name = "GUIImage" + GetId("GUIImageUndestroyable"); AddToHistory(tempGameObject, DestroyImage); return(tempGameObject); }
public static GameObject CreateCoolEffect() { tempGameObject = PullController.GetObject("CoolEffect"); if (tempGameObject == null) { tempGameObject = GameObject.Instantiate(ResourcesController.Load("Prefabs/CoolLetterEffect")) as GameObject; } tempGameObject.name = "CoolEffect" + GetId("CoolEffect"); AddToHistory(tempGameObject, DestroyCoolEffect); return(tempGameObject); }
public Puller(string subject, string consumerGroup, bool isBroadcast, TagType tagType, string[] tags, ConsumeMode consumeMode, PullController controller, PullStrategy pullStrategy, LoadBalance loadBalance) { _subject = subject; _originSubject = RetrySubjectUtils.RealSubject(_subject); _consumerGroup = consumerGroup; _isBroadcast = isBroadcast; _consumeMode = consumeMode; _tagType = (_tags == null || _tags.Length == 0) ? (byte)0 : (byte)tagType; _tags = tags; _controller = controller; _pullStrategy = pullStrategy; _loadBalance = loadBalance; }
private void Awake() { pullController = GameObject.Find("GameController").GetComponent <PullController>(); audioSource = GameObject.Find("GameController").GetComponent <AudioSource>(); rigid = gameObject.GetComponent <Rigidbody>(); joy = GameObject.Find("JoyShoot").GetComponent <Joystick>(); lifeTime = bullet.lifeTime; SeleccionarBala(); BulletAspect(); //shootPoint = GameObject.Find("ShootPoint").transform; //GravityBullet(); //SeleccionarBala(); //BulletAspect(); //EleguirDireccion(); }
public static void DestroyImageAlpha(GameObject gameObject) { PullController.AddObject("GUIImageAlphaUndestroyable", gameObject); if (gameObject.GetComponent <Renderer> ()) { if (gameObject.GetComponent <Renderer> ().material.HasProperty("_Color")) { var color = gameObject.GetComponent <Renderer> ().material.color; gameObject.GetComponent <Renderer> ().material.color = new Color(color.r, color.g, color.b, 1f); } gameObject.GetComponent <Renderer> ().material.SetTextureScale("_MainTex", new Vector2(1f, 1f)); gameObject.GetComponent <Renderer> ().material.SetTextureOffset("_MainTex", new Vector2(0f, 0f)); gameObject.GetComponent <Renderer> ().material.mainTextureOffset = new Vector2(0, 0); } history.Remove(gameObject); }
private void doStart() { PullController.pullData(); if (dao.Restaurant.getInstance().Address == null) { AppState.crudMode = AppState.CrudMode.CREATE; AppState.selectedDao = AppState.SelectedDao.RESTAURANT; } else { Console.WriteLine("Привет в твоем ресторане: " + dao.Restaurant.getInstance().Name); Console.WriteLine("С чем будем работать?"); Console.WriteLine("1 - Клиенты"); // AppState.SelectedDao.CLIENT Console.WriteLine("2 - Продукты"); // AppState.SelectedDao.PRODUCT Console.WriteLine("3 - Блюда"); // AppState.SelectedDao.DISH Console.WriteLine("4 - Работники"); // AppState.SelectedDao.WORKER Console.WriteLine("5 - Склад"); // AppState.SelectedDao.STORY Console.WriteLine("6 - Меню"); // AppState.SelectedDao.MENU Console.WriteLine("7 - Ресторан"); // AppState.SelectedDao.RESTAURANT } }
internal DefaultPullConsumer(string subject, string group, ConsumeMode mode, bool isBroadcast, string appCode, string metaServer, TagType tagType, string[] tags) { CheckArgument(subject, group, isBroadcast); if (isBroadcast) { group = ClientId.CurrentUniqeConsumerGroup; } Subject = subject; ConsumerGroup = group; ConsumeMode = mode; IsBroadcast = isBroadcast; _localBuffer = new ConcurrentQueue <Message>(); _controller = new PullController(appCode, metaServer); var retrySubject = RetrySubjectUtils.BuildRetrySubject(subject, group); _pullers[0] = new Puller(retrySubject, group, isBroadcast, tagType, tags, mode, _controller, new WeightPullStrategy(), new RoundRobinLoadBalance()); _pullers[1] = new Puller(subject, group, isBroadcast, tagType, tags, mode, _controller, new AlwaysPullStrategy(), new WeightLoadBalance()); }
public bool EngineStart() { GrindingSettings.LoadSettings(); if (!ObjectManager.InGame) { Logging.Write(LogType.Info, "【地面战斗】先登录游戏"); return(false); } if (ObjectManager.MyPlayer.IsDead && ObjectManager.MyPlayer.IsGhost) { Logging.Write(LogType.Info, "【地面战斗】先复活吧"); return(false); } if (CurrentProfile == null) { Logging.Write(LogType.Info, "【地面战斗】先读取一个Profile文件"); return(false); } Navigator = new GrindingNavigator(); Navigation = new GrindingNavigation(CurrentProfile); GrindingSettings.LoadSettings(); ToTown.SetToTown(false); switch (CurrentMode) { case Mode.TestToTown: Logging.Write(LogType.Warning, "Starting Grinding engine in TestToTown mode, next start will be in normal mode THIS IS TODO"); //TODO break; default: _states = new List <MainState> { new StatePull(), new StateLoot(), new StateMoving(), new StateTrainer(), new StateResting(), new StateResurrect(), new StateCombat(), new StateToTown(), new StateVendor(), }; break; } Stuck.Run(); CurrentMode = Mode.Normal; CombatHandler.CombatStatusChanged += CombatChanged; CloseWindows(); loots = 0; _kills = 0; _death = 0; _xpInitial = ObjectManager.MyPlayer.Experience; _startTime = DateTime.Now; /* * if (GrindingSettings.ShouldTrain) * { * ShouldTrain = GrindingShouldTrain.ShouldTrain(); * }*/ PullController.Start(); return(true); }
public static void DestroyAudio(GameObject gameObject) { PullController.AddObject("AudioUndestroyable", gameObject); history.Remove(gameObject); }
void Start() { instance = this; }
public static void DestroyCoolEffect(GameObject gameObject) { PullController.AddObject("CoolEffect", gameObject); history.Remove(gameObject); }