/// <summary> /// 读取下一个对话 /// </summary> /// <param name="readData">对话内容</param> /// <param name="commandAuto">自动执行指令</param> /// <returns>有可读的对话</returns> public static bool Next(ref ReadData readData, bool commandAuto = true) { if (Ins.m_currentData == null) { Debug.LogWarning("剧本未读取"); return(false); } Ins.EndCurrentCommads(); Ins.m_currentIndex++; if (Ins.CurrentDialogue == null) { if (Ins.m_currentData.nextScenario != null) { return(Read(Ins.m_currentData.nextScenario, ref readData, commandAuto)); } else { Ins.m_currentIndex--; return(false); } } else { ReadDialogue(ref readData, commandAuto); return(true); } }
private void GoToIns() { Ins.SetActive(true); Posture.SetActive(false); TutorialCameraController.myCameraState = TutorialCameraController.CameraState.App; //HintPosInsBack 暂时不用 }
public static void RequestPath(Vector2 pathStart, Vector2 pathEnd, Action <Vector2[], bool> callback) { PathRequest newRequest = new PathRequest(pathStart, pathEnd, callback); Ins.pathRequestQueue.Enqueue(newRequest); Ins.TryProcessNext(); }
public void Particle(string name, Vector2 position, bool active = true, Transform parent = null) { GameObject gameObject = ObjectPool.Ins.PopFromPool(name, position, active, parent); ParticleSystem particle = gameObject.GetComponent <ParticleSystem>(); Ins.StartCoroutine(Remover(gameObject, () => particle.isStopped)); }
public void TestMoreExamplesO() { // ARRANGE using (FileStream FS = File.OpenRead("CodeFiles\\more_examples.o")) { byte[] Content = new byte[FS.Length]; FS.Read(Content, 0, Content.Length); // ACT IEnumerable <Instruction> Instructions = Instruction.LinearSweep(Content); StringBuilder Buffer = new StringBuilder(); foreach (Instruction Ins in Instructions) { Buffer.AppendLine(Ins.ToString()); } Buffer.Length += -2; string Commands = Buffer.ToString(); // ASSERT Assert.True(!String.IsNullOrEmpty(Commands)); } }
/// <summary> /// Plays a SoundConnection on SoundManager that matches the level name. /// </summary> /// <param name='levelName'> /// The levelName of the SoundConnection. /// </param> /// <param name='syncPlaybackTime'> /// Whether the playback times should be synced. /// </param> /// <param name='trackNumber'> /// Track number to skip to, starting at 0. /// </param> public static void PlayConnection(string levelName, bool syncPlaybackTime = false, int trackNumber = 0) { int currentTimeSamples = 0; AudioSource currentSource = null; if (syncPlaybackTime) { currentSource = GetCurrentAudioSource(); if (currentSource != null) { currentTimeSamples = currentSource.timeSamples; } } for (int i = 0; i < trackNumber; i++) { Next(); } Ins._PlayConnection(levelName); if (syncPlaybackTime) { currentSource = GetCurrentAudioSource(); if (currentTimeSamples > currentSource.clip.samples) { Debug.LogWarning("Your clips are not of equal length. SyncPlayback has restarted the new track"); currentTimeSamples = 0; } currentSource.timeSamples = currentTimeSamples; } }
public static DataCollectionViewEntity toDataCollectionEntity(this Ins ins) { return(new DataCollectionViewEntity() { Id = ins.InsOwnId, CarLicPlateAssociationId = ins.InsCarTarId, EntityId = ins.InsChrTo, AddressValueFrom = ins.InsIndFrom, ReturnKm = ins.InsKmInt, ExitKm = ins.InsKmOut, PathologyId = ins.InsPatId, PatientId = ins.InsPerId, ServiceDate = ins.InsSvrDat, ServiceType = ins.InsTyp, Rescuer1Id = ins.InsSoc1Id, Rescuer2Id = ins.InsSoc2Id.HasValue ? ins.InsSoc2Id.Value : -1, DriverId = ins.InsAutId, BillNumber = ins.InsBilNum, ReturnTime = ins.InsTimIn, ExitTime = ins.InsTimOut, TagNumber = ins.InsCrtNum, PlaceValueFrom = ins.InsPlcFrom, PlaceValueTo = ins.InsPlcTo, AddressValueTo = ins.InsIndTo }); }
private void Awake() { Vehicle = GetComponent <BaseEntity>(); if (Vehicle == null) { End(); } var Boat = Vehicle as MotorRowboat; var Copter = Vehicle as MiniCopter; if (Boat) { FuelTank = Boat.fuelStorageInstance.Get(true).GetComponent <StorageContainer>(); } else if (Copter) { FuelTank = Copter.fuelStorageInstance.Get(true).GetComponent <StorageContainer>(); } else { End(); } Ins.cachedVehicles.Add(this); if (Ins.cachedVehicles.Count == 1) { Ins.Subscribe("OnItemRemovedFromContainer"); Ins.Subscribe("OnEntityDismounted"); Ins.Subscribe("CanLootEntity"); } if (FuelTank.inventory.GetSlot(0) == null) { AddFuel(); } }
/// <summary> /// 移除一个事件 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="listener"></param> public static void RemoveListener <T>(EventDelegate <T> listener) where T : EventObject { if (!IsIns) { return; } Ins.RemoveListenerInternal(listener); }
private Ins GetOpCode(ushort word0) { int opCodeNum = word0 & opcodeH; Ins opCode = (Ins)opCodeNum; return(opCode); }
/** * Constructeur avec parametres * @param x : position du bouton en x * @param y : position du bouton en y * @param up : chemin relatif de l'image du bouton non appuye * @param hover : chemin relatif de l'image du bouton survol * @param son : recuperation du son */ public BoutonTexture(float posX, float posY, TypeBouton normal, TypeBouton hover, TypeBouton appuyer) : base(posX, posY) { mSprtNormal = Ins.GetSpriteBouton(normal); mSprtHover = Ins.GetSpriteBouton(hover); mSprtAppuyer = Ins.GetSpriteBouton(appuyer); mSprtNormal.Position = new Vector2f(mPositionX, mPositionY); mSprtHover.Position = new Vector2f(mPositionX, mPositionY); mSprtAppuyer.Position = new Vector2f(mPositionX, mPositionY); }
public void Test_for_DIV() { string code = "DIV A,B"; var statement = li.Interpret(code); Ins expected = Ins.DIV; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x06, (Int16)expected); }
public void Test_for_SUB() { string code = "SUB A,B"; var statement = li.Interpret(code); Ins expected = Ins.SUB; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x03, (Int16)expected); }
public void Test_for_ADD() { string code = "ADD A,B"; var statement = li.Interpret(code); Ins expected = Ins.ADD; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x02, (Int16)expected); }
public void Test_for_IFU() { string code = "IFU A,B"; var statement = li.Interpret(code); Ins expected = Ins.IFU; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x17, (Int16)expected); }
public void Test_for_XOR() { string code = "XOR A,B"; var statement = li.Interpret(code); Ins expected = Ins.XOR; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x0C, (Int16)expected); }
private static void ReadDialogue(ref ReadData readData, bool commandAuto) { readData.SetData(Ins.m_currentData, Ins.CurrentDialogue); Ins.RefreshCommandTime(); if (commandAuto) { Ins.DoCurrentCommands(); } }
public void Test_for_MLI() { string code = "MLI A,B"; var statement = li.Interpret(code); Ins expected = Ins.MLI; Assert.AreEqual(expected, statement.Instruction); Assert.AreEqual(0x05, (Int16)expected); }
/// <summary> /// Gets the current song. /// </summary> /// <returns> /// The current song. /// </returns> public static AudioClip GetCurrentSong() { if (!Ins.IsPlaying() || Ins.currentSource.clip == null) { return(null); } return(Ins.currentSource.clip); }
// 异步加载场景 public static void LoadSceneAsync(string sceneName) { foreach (var syss in _Sys) { syss.OnSceneExit(_CurScene); } _LoadingAo = SceneManager.LoadSceneAsync(sceneName); Ins.StartCoroutine(LoadScene(_LoadingAo, sceneName)); }
public void Update() { if (Ins.Union(Outs).Select(f => f.TableName).Distinct().Count() > 1) { QueryType = QueryType.MultiTable; } else { QueryType = QueryType.SingleTable; } }
private Dictionary <int, Ins> page = new Dictionary <int, Ins>(); // 页 public Page(int startPos, int inTime) { this.inTime = inTime; lastUseTime = inTime; this.startPos = startPos / 10 * 10; for (int i = 0; i < 10; ++i) { Ins newIns = insList[this.startPos + i]; page.Add(i, newIns); } }
public void Reducerile(string[,] matriceTerm) { productii.Add("E E"); foreach (var In in listeGenerate) { foreach (string Ins in In) { //E E. if (Ins.IndexOf(".") == (Ins.Count() - 1)) { // E E. int indexIn = DaIndexList(listeGenerate, In); string ceva = EliminaPuncat(Ins); // E E char urmator = Ins[0]; string prod = eliminaPrmElementProductie(ceva); // E for (int i = 0; i < productii.Count(); i++) { string fff = productii[i]; string pro = eliminaPrmElementProductie(productii[i]); int indexProductie = i + 1; if (pro == " E" && ceva == "E E" && urmator == 'E') { int coloana = terminali.IndexOf("$"); matriceTerm[indexIn, coloana] = "acc" + " "; } else if (prod == pro) { for (int j = 0; j < urmatorii.Count; j++) { if (urmatorii[j].StartsWith(urmator.ToString())) { string[] urmatorul = urmatorii[j].Split(' '); foreach (var item in urmatorul[1]) { int coloana = terminali.IndexOf(item.ToString()); matriceTerm[indexIn, coloana] = "r" + indexProductie + " "; } } } } } } } } }
/*重写Cache区域内容*/ public void writeNewCache(int cacheNum, Page page) { string cacheName = "listBox" + cacheNum.ToString(); ListBox refreashBox = (ListBox)this.Controls.Find(cacheName, true)[0]; refreashBox.Items.Clear(); for (int offset = 0; offset < 10; ++offset) { Ins ins = page.findCertainIns(offset); string instruction = ins.pos.ToString() + ":" + ins.content + ' ' + ins.nextPos.ToString(); refreashBox.Items.Add(instruction); } }
private void Awake() { if (GetComponent <Image>() != null) { thisImage = GetComponent <Image>(); } else if (GetComponent <Text>() != null) { thisText = GetComponent <Text>(); } doThis = Ins.Rup; }
public Action <IOperandVal, IOperandVal, IDCPU> GetOperations(Ins instruction) { Action <IOperandVal, IOperandVal, IDCPU> value; if (operationTable.TryGetValue(instruction, out value)) { return(value); } else { //TODO: Throw Exception return(null); } }
public static void RemoveEnemy(Enemy enemy) { if (enemy == Ins.selectedEnemy) { if (Ins.enemyList.Count > 1) { Ins.SelectEnemy(Ins.enemyList[(Ins.enemyList.IndexOf(enemy) + 1) % Ins.enemyList.Count]); } } Ins.enemyList.Remove(enemy); if (Ins.enemyList.Count == 0) { Ins.result = BattleResult.Win; BattleManager.sResult(); } }
public void End(bool remove = false) { FuelTank?.inventory?.Clear(); if (remove) { Ins.cachedVehicles.Remove(this); if (Ins.cachedVehicles.Count < 1) { Ins.Unsubscribe("OnItemRemovedFromContainer"); Ins.Unsubscribe("OnEntityDismounted"); Ins.Unsubscribe("CanLootEntity"); } } Destroy(this); }
/// <summary> /// n秒后开启一个回调 /// </summary> public void StartCounting(float n, Action callBack) { if (n <= 0f) { return; } _isRepeat = false; _callBack = callBack; _repeatTime = 0; _intervalTime = n; _currTimer = 0f; _counter = 0; Start(); Ins.Add(this); }
public void ClickBackButtonIns() { Debug.Log("ClickInsBack"); if (deactiveButtons) { return; } HintScreen.SetActive(false); Ins.SetActive(false); Hide(CameraBackground); TutorialCameraController.myCameraState = TutorialCameraController.CameraState.Subway; forwardOneStep = true; }