internal void DrawOverlays(Helpers.ZBufferedTexture T) { if (OverlayTypeIndex != -1) { var OTypes = CCFactory <OverlayTypeClass, OverlayClass> .Get().FactoryItems; var OT = OTypes[OverlayTypeIndex]; var pos = TacticalPosition + new CellStruct(30, 15) + OverlayPosition; pos.Y -= (2);// + OverlayPosition.Y); var tImage = OT.SHPImage.Value; if (OT.Tiberium) { var ix = OverlayClass.OverlayToTiberium(OverlayTypeIndex); if (ix != -1) { var t = TiberiumClass.All[ix]; OverlayTypeClass tOverlay; if (Slope != 0) { tOverlay = OTypes[t.NumImages + t.NumExtraImages / 4 * (Slope - 1) + t.Overlay.ArrayIndex]; } else { tOverlay = OTypes[t.Overlay.ArrayIndex + X * Y % t.NumImages]; } // tImage.DrawIntoTexture(T, pos, (uint)OverlayState, MapTheater.TemperatePAL); } } else if (OT.Wall) { // tImage.DrawIntoTexture(T, pos, (uint)OverlayState, MapTheater.unitPAL); } } }
public override void applicationRunOnceOnBuilding () { #if !UNITY_EDITOR if(Application.isMobilePlatform) { Cursor.visible = false; // Once Android cursor bug is fixed, you can delete the next 3 lines. Texture2D cursorTexture = new Texture2D(1, 1); cursorTexture.SetPixel(0, 0, Color.clear); Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto); } #endif //CCGLView { GameObject obj = new GameObject (); obj.transform.parent = _window.transform; _view = obj.AddComponent<CCGLView> (); } //CCComponentsPool { GameObject obj = new GameObject(); obj.transform.parent = this.transform; _factory = obj.AddComponent<CCFactory>(); } //audio { GameObject obj = new GameObject (); obj.transform.parent = this.transform; _audioEngine = obj.AddComponent<SimpleAudioEngine> (); } }
private void LoadMap() { //if (Map.Preview != null) { // MapPreview = Map.GetPreviewTexture(GraphicsDevice); //} else { // MapPreview = null; //} Map.Initialize(); Tactical.SetMap(Map); INI.Rules_Combined = new INI(); INI.Rules_Combined.CombineWithFile(INI.Rules_INI); INI.Rules_Combined.CombineWithFile(Map.MapFile); TiberiumClass.LoadListFromINI(INI.Rules_Combined); OverlayTypeClass.LoadListFromINI(INI.Rules_Combined); IsoTileTypeClass.LoadListFromINI(Map.TheaterData, true); IsoTileTypeClass.PrepaintTiles(); TiberiumClass.All.ReadAllFromINI(INI.Rules_Combined); CCFactory <OverlayTypeClass, OverlayClass> .Get().ReadAllFromINI(INI.Rules_Combined); Map.SetupOverlays(); }
public void BasicTest() { CCVirtualFactory ccFactory = new CCFactory <UDTCC>(); CC cc = ccFactory.create(); cc.init(); cc.onACK(2); cc.onLoss(new int[] { 1, 3, 5, 7 }, 4); cc.onTimeout(); cc.onACK(6); cc.onLoss(new int[] { 4 }, 1); cc.onTimeout(); cc.close(); }