private void Awake() { GameObject gameObject = GameObject.Find("Me"); if (null == gameObject) { Debug.LogError("Fail to find Me"); } else { localController = gameObject.GetComponent <LocalController>(); if (null == localController) { Debug.LogError("Fail to get LocalController component for Me"); } } if (localController != null) { localController.CheckRespawnItemHave(); resTime -= resTime * localController.RespwanTimeDec; if (resTime < 0f) { resTime = 0f; } } respawnTimeSecure.Init(resTime); NoCheat.Instance.Sync(NoCheat.WATCH_DOG.RESPAWMTIME, resTime); }
private void CheckMyself(Vector3 boomPos, float DamageRadius) { GameObject gameObject = GameObject.Find("Me"); if (null == gameObject) { Debug.LogError("Fail to find Me"); } else { LocalController component = gameObject.GetComponent <LocalController>(); if (null == component) { Debug.LogError("Fail to get LocalController component for Me"); } else { Vector3 position = gameObject.transform.position; if (Vector3.Distance(position, boomPos) < DamageRadius) { component.GetHit(MyInfoManager.Instance.Seq, poisonDamage, 1f, -4, -1, autoHealPossible: true, checkZombie: false); } } } }
public void Create(Group group) { using (ApplicationDbContext context = new ApplicationDbContext()) { LocalController lc = context.LocalControllers.Include("Groups").FirstOrDefault(l => l.Code == group.LCCode); if (lc != null) { if (!lc.Groups.Any(g => g.Name == group.Name)) { lc.Groups.Add(group); context.SaveChanges(); } else { MessageBox.Show("The group with this name already exists in local system.", "Name taken", MessageBoxButton.OK, MessageBoxImage.Error); } } else { MessageBox.Show("Can't find Local Controller.", "Local Controller error", MessageBoxButton.OK, MessageBoxImage.Error); } } }
public override void StartItem() { if (IsMyItem()) { GameObject gameObject = GameObject.Find("Me"); if (null != gameObject) { LocalController component = gameObject.GetComponent <LocalController>(); if (component != null) { component.EquipSmokeBomb(); } } } else { GameObject gameObject2 = BrickManManager.Instance.Get(useUserSeq); if (gameObject2 != null) { LookCoordinator component2 = gameObject2.GetComponent <LookCoordinator>(); if (component2 != null) { component2.EquipSmokeBomb(); } } } }
private void Start() { localController = null; brickSeq = -1; shooter = -1; InitializeAnimation(); audioSource = GetComponent <AudioSource>(); BrickProperty component = base.transform.parent.GetComponent <BrickProperty>(); if (null == component) { Debug.LogError("ERROR, Fail to get brick sequence number for cannon controller"); } else { brickSeq = component.Seq; } if (null != axle) { SaveAxleAngle(); } muzzleFxInstances = new GameObject[muzzles.Length]; for (int i = 0; i < muzzles.Length; i++) { muzzleFxInstances[i] = null; } }
public override bool Update() { if (!battleChat.IsChatting && custom_inputs.Instance.GetButtonDown(editorToolScript.inputKey) && IsEnable()) { active = true; phase = PHASE.NONE; start = new Vector3(10000f, 10000f, 10000f); end = new Vector3(10000f, 10000f, 10000f); return(true); } if (!battleChat.IsChatting && custom_inputs.Instance.GetButtonDown(editorToolScript.inputKey) && !IsEnable()) { GameObject gameObject = GameObject.Find("Me"); if (null != gameObject) { LocalController component = gameObject.GetComponent <LocalController>(); if (null != component) { component.addStatusMsg(StringMgr.Instance.Get("ITEM_USED_ALL")); } } return(false); } return(false); }
private void InitializeFirstPerson() { int[] usables = new int[1] { 4 }; GameObject gameObject = GameObject.Find("Me"); if (null == gameObject) { Debug.LogError("Fail to find Me"); } else { EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>(); if (null == component) { Debug.LogError("Fail to get EquipCoordinator component for Me"); } else { component.Initialize(usables); } localController = gameObject.GetComponent <LocalController>(); if (null == localController) { Debug.LogError("Fail to get LocalController component for Me"); } } }
private void Start() { play = 0; playDelta = 0f; dummyDelta = 0f; remain = RoomManager.Instance.TimeLimit; GameObject gameObject = GameObject.Find("Me"); if (null == gameObject) { Debug.LogError("Fail to find Me"); } else { localController = gameObject.GetComponent <LocalController>(); if (null == localController) { Debug.LogError("Fail to get LocalController component for Me"); } } zombieMatch = GetComponent <ZombieMatch>(); backChange.position.x = (float)(bkgnd.width / 2) + expandArea; backChange.position.y = (float)(bkgnd.height / 2) + expandArea; backChange.texImage = bkgnd; backChange.startSize = 1f; backChange.AddStep(1.5f, 0.28f); backChange.AddStep(1f, 0.28f); backChange.repeat = true; }
private void Start() { play = 0; playDelta = 0f; remain = RoomManager.Instance.TimeLimit; GameObject gameObject = GameObject.Find("Me"); if (null == gameObject) { Debug.LogError("Fail to find Me"); } else { localController = gameObject.GetComponent <LocalController>(); if (null == localController) { Debug.LogError("Fail to get LocalController component for Me"); } } if (RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.BUNGEE || RoomManager.Instance.CurrentRoomType == Room.ROOM_TYPE.ESCAPE) { offset.x = (float)((Screen.width - bkgnd.width) / 2); } backChange.position.x = (float)(bkgnd.width / 2) + expandArea; backChange.position.y = (float)(bkgnd.height / 2) + expandArea; backChange.texImage = bkgnd; backChange.startSize = 1f; backChange.AddStep(1.5f, 0.28f); backChange.AddStep(1f, 0.28f); backChange.repeat = true; }
public bool CreateExplosion(Vector3 pos) { if (MyInfoManager.Instance.IsBelow12()) { Object.Instantiate((Object)explosionEffect11, pos, Quaternion.Euler(0f, 0f, 0f)); } else { Object.Instantiate((Object)explosionEffect, pos, Quaternion.Euler(0f, 0f, 0f)); } GameObject gameObject = GameObject.Find("Me"); if (null != gameObject && Vector3.Distance(pos, gameObject.transform.position) < explosionRadius) { float num = pos.y + bombExplosionExceptHigher; Vector3 position = gameObject.transform.position; if (num > position.y) { float num2 = pos.y - bombExplosionExceptLower; Vector3 position2 = gameObject.transform.position; if (num2 < position2.y) { LocalController component = gameObject.GetComponent <LocalController>(); if (component != null && !component.IsDead) { component.GetHitBungeeBomb(useUserSeq, 32); } } } } return(false); }
//------------------------------------------------------------------- void UpdateLocalControllers() { // Only allow players to join/leave during the lobby state if (GameManager.GetInstance().m_currentState == eGameState.WAIT_FOR_READY) { for (int i = 0; i < LocalControllers.Length; ++i) { LocalController local = LocalControllers[i]; if (local == null) { KeyCode join_key = LocalController.GetActionKey(i); if (Input.GetKeyDown(join_key)) { GameObject go = GameObject.Instantiate(LocalControllerPrefab); local = go.GetComponent <LocalController>(); local.GamepadID = i; LocalControllers[i] = local; } } else { // only allow people to leave locally KeyCode leave_key = LocalController.GetCancelKey(i); if (Input.GetKeyDown(leave_key)) { GameObject.Destroy(local.gameObject); LocalControllers[i] = null; } } } } }
private void Start() { deltaTime1 = 0f; deltaTime2 = 0f; secondImgIn = false; localController = GetComponent <LocalController>(); }
private void Query(ref BaseUnitStatus.Component status, ref AdvancedUnmannedInput.Component unMannedInput, ref AdvancedUnitController.Component controller, ref LocalController local) { if (status.State != UnitState.Alive) { return; } var inter = unMannedInput.Interval; if (CheckTime(ref inter) == false) { return; } unMannedInput.Interval = inter; var x = UnityEngine.Random.Range(-1.0f, 1.0f); var y = UnityEngine.Random.Range(-1.0f, 1.0f); var isShiftDown = false; //Input.GetKey(KeyCode.LeftShift); var isJump = false; //Input.GetKey(KeyCode.Space); var action = local.Action; var stick = local.Stick; if (CommonUpdate(new Vector2(x, y), new Vector2(x, y), isShiftDown, isJump, false, false, ref stick, ref action)) { controller.Action = action; } local.Action = action; local.Stick = stick; }
private void VerifyLocalController() { if (null == localController) { localController = GetComponent <LocalController>(); } }
public void Details() { LocalController localController = new LocalController(); var result = localController.Details(2) as ViewResult; Assert.IsNotNull(result.ViewName); }
public void Delete() { LocalController localController = new LocalController(); var result = localController.Index() as ViewResult; Assert.IsNotNull(result.ViewName); }
public CadastroEventoForm(Evento evento) { this.evento = evento; eventoController = new EventoController(); categoriaController = new CategoriaController(); localController = new LocalController(); InitializeComponent(); PrepararFormulario(); }
public bool IsOnline(string code) { using (ApplicationDbContext context = new ApplicationDbContext()) { LocalController lc = context.LocalControllers.FirstOrDefault(l => l.Code.Equals(code)); return(lc != null && lc.IsOnline); } }
public async Task <List <TModel> > GetListByPeriodAndArea(Period period, SalesAreaHierarchy region) { CriteriaBuilder criteriaBuilder = new CriteriaBuilder(); return(await LocalController.GetManyByCriteria( criteriaBuilder .Add("Period", (int)period) .Add("Region", (int)region))); }
private void VerifyLocalController() { me = GameObject.Find("Me"); if (null != me) { localController = me.GetComponent <LocalController>(); equipcoord = me.GetComponent <EquipCoordinator>(); } }
private void InitializeFirstPerson() { int[] array = null; switch (RoomManager.Instance.WeaponOption) { case 2: array = new int[2] { 0, 4 }; break; case 1: array = new int[3] { 0, 1, 4 }; break; default: array = new int[5] { 0, 2, 1, 3, 4 }; break; } me = GameObject.Find("Me"); if (null == me) { Debug.LogError("Fail to find Me"); } else { EquipCoordinator component = me.GetComponent <EquipCoordinator>(); if (null == component) { Debug.LogError("Fail to get EquipCoordinator component for Me"); } else { component.Initialize(array); } localController = me.GetComponent <LocalController>(); if (null == localController) { Debug.LogError("Fail to get LocalController component for Me"); } } }
public ConfigGridControl(IConfigController configController, IExporter[] allExporters, LocalController localController, IBuildController buildController) { _allExporters = allExporters; _localController = localController; _configController = configController; _buildController = buildController; InitializeComponent(); InitializeGrid(); }
private void OnTriggerEnter(Collider other) { LocalController component = other.gameObject.GetComponent <LocalController>(); if (component != null) { component.OnTrampoline(seq); BrickManager.Instance.AnimationPlay(index, seq, "fire"); } }
public ConfigSectionControl(LocalController localController, ICoreConfigSection coreConfigSection, IExporter[] allExporters, IBuildController buildController) { _localController = localController; _coreConfigSection = coreConfigSection; _allExporters = allExporters; _buildController = buildController; DataContext = this; InitializeComponent(); }
public void ShouldGetDefaultLocalStrings() { // Arrange var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var localStrings = localController.GetLocalStringsOrDefault<TestLocalStrings>("default"); // Assert Assert.AreEqual("TestString1", localStrings.TestString1); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
public void ShouldGetDELocalStrings() { // Arrange var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var localStrings = localController.GetLocalStringsOrDefault <TestLocalStrings>("de"); // Assert Assert.AreEqual("TestString1DE", localStrings.TestString1); }
public void ShouldGetDefaultLocalStringsBecauseLanguageNotFound() { // Arrange var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var localStrings = localController.GetLocalStringsOrDefault <TestLocalStrings>("fr"); // Assert Assert.AreEqual("TestString1", localStrings.TestString1); }
public void TestLocalControllerConstructors() { LocalController lc1 = new LocalController(); LocalController lc2 = new LocalController("123"); Assert.IsNotNull(lc1); Assert.IsInstanceOf <LocalController>(lc1); Assert.IsNotNull(lc2); Assert.IsInstanceOf <LocalController>(lc2); }
private void VerifyLocalController() { if (null == localController) { GameObject gameObject = GameObject.Find("Me"); if (null != gameObject) { localController = gameObject.GetComponent <LocalController>(); } } }
private void OnTriggerEnter(Collider other) { if (!Application.loadedLevelName.Contains("MapEditor") && base.enabled) { LocalController component = other.GetComponent <LocalController>(); if (null != component) { RunScript(); } } }
public void ShouldGetLocalizedDEStrings() { // Arrange Thread.CurrentThread.CurrentCulture = new CultureInfo("de"); var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var strings = localController.GetLocalStrings<TestLocalStrings>(); // Assert Assert.AreEqual(strings.TestString1, "TestString1DE"); }
public void ShouldGetLocalizedDEStringByName() { // Arrange Thread.CurrentThread.CurrentCulture = new CultureInfo("de"); var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var strings = localController.GetLocalString(typeof(TestLocalStrings), "TestString1"); // Assert Assert.AreEqual("TestString1DE", strings); }
public void ShouldGetTestLocalStrings() { // Arrange Thread.CurrentThread.CurrentCulture = new CultureInfo("en"); var localController = new LocalController(new ILocalStrings[] { new TestLocalStrings() }); // Act var strings = localController.GetLocalStrings<TestLocalStrings>(); // Assert Assert.IsNotNull(strings); Assert.AreEqual("TestString1", strings.TestString1); }