public ArrayList OnFindPathFromNoWayPointPaths() { GameObject startPos = GameObject.Find("StartPos"); GameObject endPos = GameObject.Find("EndPos"); Vector3 startPosVec = CUtility.RoundVector3(startPos.transform.position); Vector3 endPosVec = CUtility.RoundVector3(endPos.transform.position); CAStar AStar = new CAStar(); AStar.InitTiles(ref Tiles); int StartIdx = (int)(startPosVec.y * Size + startPosVec.x); int EndIdx = (int)(endPosVec.y * Size + endPosVec.x); ArrayList InitTiles = AStar.GetTiles(); PathIdxs = AStar.FindPaths(StartIdx, EndIdx, 0); ArrayList PathTiles = new ArrayList(); for (int i = 0; i < PathIdxs.Count; ++i) { Tile CurTile = InitTiles[(int)PathIdxs[i]] as Tile; PathTiles.Add(CurTile); } return(PathTiles); }
private void UpdateToolPresentation() { // Create a temp module string toolPrefabFile = CNetwork.Factory.GetRegisteredPrefabFile(CToolInterface.GetPrefabType(m_CurrentToolType.Get())); GameObject toolObject = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/" + toolPrefabFile)); // Destroy the old module if (m_ParentToolObject.transform.childCount != 0) { Destroy(m_ParentToolObject.transform.GetChild(0).gameObject); } // Update the tool info UpdateToolInfo(toolObject.GetComponent <CToolInterface>()); // Destroy the non rendering CUtility.DestroyAllNonRenderingComponents(toolObject); // Add it to the child object toolObject.transform.parent = m_ParentToolObject.transform; // Reset some values CUtility.SetLayerRecursively(toolObject, LayerMask.NameToLayer("UI 3D")); toolObject.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); toolObject.transform.localRotation = Quaternion.identity; // Set the scale a lot smaller toolObject.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); }
// Update is called once per frame void Update() { if (CUtility.IsOut(transform.position)) { Destroy(gameObject); } }
public void Print() { foreach (Tag t in _tags.Values) { CUtility.Log(string.Format("{0} {1} {2}", t.Label, t.Called, t.Confirmed)); } }
public SubscriptionResponse Subscribe(string mobileNumber, InputMechanisms inputMechanism, string keyword, string shortCode, int reference) { SubscriptionResponse response = new SubscriptionResponse { MobileNumber = mobileNumber, Service = this.service, NetworkID = CUtility.GetNetworkID(mobileNumber) }; if (IsSubscribed(mobileNumber, this.service.ID)) { response.Status = ServiceMessages.AlreadySubscribed; return(response); } response.SubscriptionID = AddSubscription(service.ID, mobileNumber, response.NetworkID, reference, shortCode, keyword); SendSubscribeResponse(service, response.SubscriptionID, mobileNumber, reference, CSubscriptionEngineCapsule.RequestResults.Success); AddSubscriptionInteraction(response.SubscriptionID, (int)inputMechanism, InteractionTypes.Subscribe); AddSubscriptionInteraction(response.SubscriptionID, (int)inputMechanism, InteractionTypes.Confirmation); PaymentWrapper.WrapperResponse paymentResponse = null; bool result = Execute(service.PaymentSystemClientID, service.ID, response.SubscriptionID, mobileNumber, response.NetworkID, service.BillingAmount, true, reference, out paymentResponse); if (!result) { response.Exception = string.Format("{0}: {1}", paymentResponse.statusDescription, paymentResponse.Exception); response.Status = ServiceMessages.FailedBillings; return(response); } response.Status = ServiceMessages.SubscriptionActivated; return(response); }
void Start() { float each_angle = max_angle / (max_count - 1); float half_angle = max_angle / 2.0f; Vector3 center_vec = end_pos - gameObject.transform.position; Vector3 left_vec = Quaternion.AngleAxis(half_angle, Vector3.back) * center_vec; for (int i = 0; i < max_count; ++i) { Vector3 rotated_end_pos = Quaternion.AngleAxis(each_angle * i, Vector3.forward) * left_vec; Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, rotated_end_pos + gameObject.transform.position); // 이미지를 회전 시켜서 위로 바라 보게 만든다. Vector3 eulerAngles = newRotation.eulerAngles; eulerAngles.z += 90.0f; newRotation = Quaternion.Euler(eulerAngles); GameObject LoadedObj = Instantiate <GameObject>(CResourceMgr.LoadEffect("Arrow"), gameObject.transform.position, newRotation); CArrow Arrow = LoadedObj.GetComponent <CArrow>(); Arrow.Speed = speed; Arrow.Owner = Owner; Arrow.EndPos = rotated_end_pos + gameObject.transform.position; Arrow.HitAniType = HitAniType; } Destroy(gameObject); }
/// <summary> /// il tick è il momento in cui vengono prese le decisioni di buy/sell /// </summary> private void OnTick() { CUtility.Log("*** tick"); // in questo simulatore se il mercato scende non ci muoviamo if (_trend < 0) { // verifico se ci sono bolle irraggiungibili if (EnableBubbleDestruction) { CheckBubblesToCancel(); } CUtility.Log("*** trend down... skip"); return; } // analizzo il numero di bolle, per crearne almeno una var numBubbles = _market.Bubbles.Count() + WishList.Count(); if (numBubbles < _configuration.MaxBubbles) { CreateBubble(); } // mostro le bolle _market.ShowBubbles(); }
private void UpdateModuleInfo(CModuleInterface _tempModuleInterface) { // DEBUG: Make a random sentance to describe it string desc = CUtility.LoremIpsum(6, 12, 2, 4, 1); m_SelectedModuleType = _tempModuleInterface.ModuleType; m_SelectedModuleCategory = _tempModuleInterface.ModuleCategory; m_SelectedModuleSize = _tempModuleInterface.ModuleSize; m_SelectedModuleCost = m_SelectedModuleSize == CModuleInterface.ESize.Small ? 400 : 800; // Set the name string name = CUtility.SplitCamelCase(m_SelectedModuleType.ToString()); m_ModuleNameLabel.text = name; // Set the category m_ModuleCategoryLabel.text = m_SelectedModuleCategory.ToString(); // Set the size UpdateSizeInfo(m_SelectedModuleSize, m_SmallModuleSprite, m_MediumModuleSprite, m_LargeModuleSprite); // Set the desc m_ModuleDescLabel.text = desc; // Set the cost m_ModuleCostLabel.text = m_SelectedModuleCost.ToString() + "N"; }
public void Load() { for (int i = 0; i < SpriteName.Length - 1; ++i) { BulletSprite[i] = CUtility.GetSprite(SpriteName[0], SpriteName[i + 1]); } }
// Update is called once per frame void Update() { float ShotSpeed = 3.0f; int wayNum = 5; float angle = 40.0f; Count++; player = GameObject.FindGameObjectWithTag("Player"); if (player != null) { if (Count % 70 == 0) { for (int i = 0; i < wayNum; i++) { Vector2 vec = player.transform.position - transform.position; vec.Normalize(); float anglePerShot = angle / (wayNum - 1); vec = Quaternion.Euler(0, 0, anglePerShot * i - angle / 2.0f) * vec; vec *= ShotSpeed; var q = Quaternion.Euler(0, 0, -Mathf.Atan2(vec.x, vec.y) * Mathf.Rad2Deg); var t = Instantiate(EneShot02, transform.position, q); t.GetComponent <Rigidbody2D>().velocity = vec; } } } else { angle = Mathf.PI + (Mathf.PI / 2); } if (CUtility.IsOut(transform.position)) { Destroy(gameObject); } }
private void _SetAnim(string Name) { _animName = Name; _animator.Play(Name); _animator.speed = _animSpeed; CUtility.DestroyChildren(_propViewContent); mUI.CreateTextElement(_propViewContent, Name, "text", CToolkitUI.ETextStyle.TS_HEADING); GameObject foldContent; mUI.CreateFoldOut(_propViewContent, "Animation Details", out foldContent); GameObject fieldEditor; mUI.CreateFieldElement(foldContent, "Name", out fieldEditor); mUI.CreateTextElement(fieldEditor, Name); Animation.CAnimationEntry entry = Animation.GetAnimEntry(Name); if (entry == null) { mUI.CreateTextElement(_propViewContent, "No Matching Animation Entry!"); } else { mUI.CreateFieldElement(foldContent, "Framerate", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mFPS.ToString()); mUI.CreateFieldElement(foldContent, "Start Time", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mStartTime.ToString()); mUI.CreateFieldElement(foldContent, "Duration", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mDuration.ToString()); mUI.CreateFieldElement(foldContent, "Speed Mod", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mSpeed.ToString()); } }
void Start() { // Ensure a type is defined if (m_ModuleType == EType.INVALID) { Debug.LogError(string.Format("This module has not been given a module type. GameObjectName({0})", gameObject.name)); } // Ensure a category is defined if (m_ModuleCategory == ECategory.INVALID) { Debug.LogError(string.Format("This module has not been given a module category. GameObjectName({0})", gameObject.name)); } // Ensure a size is defined if (m_ModuleSize == ESize.INVALID) { Debug.LogError(string.Format("This module has not been given a module size. GameObjectName({0})", gameObject.name)); } // Register self with parent facility CFacilityInterface fi = CUtility.FindInParents <CFacilityInterface>(gameObject); if (fi != null) { fi.RegisterModule(this); m_cParentFacility = fi.gameObject; } else { Debug.LogError("Could not find facility to register to"); } }
public void Log(string msg) { if (MainConfiguration.Configuration.Verbose) { CUtility.Log(msg); } }
private void OnClickAsset(string AssetName) { CUtility.DestroyChildren(_propertiesContent); CAssetDeclaration decl = CGame.AssetManager.GetDeclaration(AssetName); mUI.CreateTextElement(_propertiesContent, "Selected " + decl.mName, "text", CToolkitUI.ETextStyle.TS_HEADING); GameObject foldContent; mUI.CreateFoldOut(_propertiesContent, "Asset Details", out foldContent); GameObject fieldEditor; mUI.CreateFieldElement(foldContent, "Name", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mName); mUI.CreateFieldElement(foldContent, "File Path", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mFileName); mUI.CreateFieldElement(foldContent, "Type", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mType.ToString()); //mUI.CreateFieldElement(foldContent, "Modified Date", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mModifiedDate); GameObject btn = mUI.CreateButton(_propertiesContent, "Edit", () => { mToolkit.EditAsset(AssetName); }); mUI.AddLayout(btn, -1, 20, 1.0f, -1); //btn = mUI.CreateButton(_propertiesContent, "Delete"); mUI.AddLayout(btn, -1, 20, 1.0f, -1); }
void Start() { // Ensure a type of defined if (m_eComponentType == EType.INVALID) { Debug.LogError(string.Format("This component has not been given a component type. GameObjectName({0})", gameObject.name)); } // Register self with parent module CModuleInterface mi = CUtility.FindInParents <CModuleInterface>(gameObject); if (mi != null) { mi.RegisterAttachedComponent(this); } else { Debug.LogError("Could not find module to register to"); } if (EventHealthChange != null) { EventHealthChange(this, GetComponent <CActorHealth>()); } }
private void Update() { pos = transform.position; if (pos.y > 0 && isReturn == false) { // Translate(x軸, y軸, z軸) // x軸がプラス →方向のベクトル // z軸がマイナス ↓方向のベクトル // この2つのベクトルを合成すると「↘️」方向のベクトルになる。(→ + ↓ = ↘️) transform.Translate(moveDistance * Time.deltaTime, 0, -moveDistance * Time.deltaTime, Space.World); } else // pos.zが1以下になった時、進行方向を変化させる。 { isReturn = true; // x軸がプラス →方向のベクトル // z軸がマイナス ↑方向のベクトル // この2つのベクトルを合成すると「↗️」方向のベクトルになる。(→ + ↑ = ↗️) transform.Translate(moveDistance * Time.deltaTime, 0, moveDistance * Time.deltaTime, Space.World); } if (CUtility.IsOut(transform.position)) { Destroy(gameObject); } }
private void _SelectTile(int X, int Y) { CUtility.DestroyChildren(_propViewContent); _selectedTileX = X; _selectedTileY = Y; if (X == -1 || Y == -1) { return; } mUI.CreateTextElement(_propViewContent, "Tile: " + X + ", " + Y, "text", CToolkitUI.ETextStyle.TS_HEADING); GameObject content; GameObject editor; mUI.CreateFoldOut(_propViewContent, "Tile Properties", out content); int solidVal = _asset.mTiles[X, Y].mSolid ? 1 : 0; mUI.CreateFieldElement(content, "Solid", out editor); mUI.CreateIntEditor(editor, solidVal, (int Value) => { _asset.mTiles[X, Y].mSolid = Value == 0 ? false : true; _ModifyAsset(); }); }
private void _RefreshGOB() { // Call modify here? // After any changes, current item state. // Created directly from asset, then additions added depending on type. // Take view direction into account. CUtility.DestroyChildren(_itemRoot); GameObject gob = _asset.CreateVisuals(EViewDirection.VD_FRONT); gob.transform.SetParent(_itemRoot.transform); // Create usage slot visuals // Create specific visuals for items that use extended models? if (_asset.mItemType == EItemType.DESK || _asset.mItemType == EItemType.REST) { for (int i = 0; i < _asset.mUsageSlots.Count; ++i) { GameObject unit = GameObject.Instantiate(CGame.PrimaryResources.Prefabs[7] as GameObject); unit.transform.SetParent(_itemRoot.transform); unit.transform.localPosition = _asset.mUsageSlots[i].mUsePosition; unit.transform.rotation = Quaternion.Euler(_asset.mUsageSlots[i].mUseRotation); Animator _animator = unit.transform.GetChild(0).GetComponent <Animator>(); _animator.Play("work_working_action_2"); } } _RebuildTileIcons(); }
private void OnImageTypeBoxChanged(object sender, EventArgs a) { CBackgroundTheme bgTheme = (CBackgroundTheme)(man.Theme); bgTheme.BgType = CUtility.StrToImageType(imageTypeBox.ActiveText); FillComboboxWithStrings(imageResolutionsBox, bgTheme.GetAvailableResolutions()); }
/// <summary> /// Vrifico se ci sono bolle particolamente vecchie da eliminare /// </summary> private void CheckBubblesToCancel() { //recupero le vecchie bolle solo se sono in una situazione di stallo e mi mancano bolle if (_market.Bubbles.Count + this.WishList.Count < _configuration.MaxBubbles*(decimal) 0.8) { return; } // ne creo solo una (distruggere le bolle costa) foreach (CBubble bubble in _market.Bubbles) { if (bubble.SellAt > _market.Ask * BubbleDestructionLevel) { // distruggi la bolla var marketValue = _market.Ask; var orderId = ""; _market.DoOrder(CUtility.OrderType.Sell, marketValue, bubble.Coins, ref orderId, true); CUtility.Log("*** Bubble destroyed"); bubble.Deleted = true; _bubblesCanceled++; // crea una bolla in wishlist WishList.Add(CBubble.Create(_market, CUtility.OrderType.Buy, bubble.Coins, bubble.BuyAt, _configuration.Gain,orderId)); break; } } var removed = _market.Bubbles.RemoveAll(o => o.Deleted == true); }
private void MapDM_Nha_San_Xuat(DataRow p_row, CDM_Nha_San_Xuat p_objDes) { DataTable p_dt = p_row.Table; if (p_dt.Columns.Contains("Auto_ID")) { p_objDes.Auto_ID = CUtility.Convert_To_Int64(p_row["Auto_ID"]); } if (p_dt.Columns.Contains("Ma_Nha_San_Xuat")) { p_objDes.Ma_Nha_San_Xuat = CUtility.Convert_To_String(p_row["Ma_Nha_San_Xuat"]); } if (p_dt.Columns.Contains("Ten_Nha_San_Xuat")) { p_objDes.Ten_Nha_San_Xuat = CUtility.Convert_To_String(p_row["Ten_Nha_San_Xuat"]); } if (p_dt.Columns.Contains("So_Dien_Thoai")) { p_objDes.So_Dien_Thoai = CUtility.Convert_To_String(p_row["So_Dien_Thoai"]); } if (p_dt.Columns.Contains("Dia_Chi")) { p_objDes.Dia_Chi = CUtility.Convert_To_String(p_row["Dia_Chi"]); } if (p_dt.Columns.Contains("Created")) { p_objDes.Created = CUtility.Convert_To_DateTime(p_row["Created"]); } if (p_dt.Columns.Contains("Created_By")) { p_objDes.Created_By = CUtility.Convert_To_String(p_row["Created_By"]); } if (p_dt.Columns.Contains("Last_Updated")) { p_objDes.Last_Updated = CUtility.Convert_To_DateTime(p_row["Last_Updated"]); } if (p_dt.Columns.Contains("Last_Updated_By")) { p_objDes.Last_Updated_By = CUtility.Convert_To_String(p_row["Last_Updated_By"]); } if (p_dt.Columns.Contains("Deleted")) { p_objDes.Deleted = CUtility.Convert_To_Bool(p_row["Deleted"]); } if (p_dt.Columns.Contains("Ghi_Chu")) { p_objDes.Ghi_Chu = CUtility.Convert_To_String(p_row["Ghi_Chu"]); } }
private void MapDM_Nha_Cung_Cap(DataRow p_row, CDM_Nha_Cung_Cap p_objDes) { DataTable p_dt = p_row.Table; if (p_dt.Columns.Contains("Auto_ID")) { p_objDes.Auto_ID = CUtility.Convert_To_Int64(p_row["Auto_ID"]); } if (p_dt.Columns.Contains("Ma_Nha_Cung_Cap")) { p_objDes.Ma_Nha_Cung_Cap = CUtility.Convert_To_String(p_row["Ma_Nha_Cung_Cap"]); } if (p_dt.Columns.Contains("Ten_Nha_Cung_Cap")) { p_objDes.Ten_Nha_Cung_Cap = CUtility.Convert_To_String(p_row["Ten_Nha_Cung_Cap"]); } if (p_dt.Columns.Contains("Dia_Chi")) { p_objDes.Dia_Chi = CUtility.Convert_To_String(p_row["Dia_Chi"]); } if (p_dt.Columns.Contains("Dien_Thoai")) { p_objDes.Dien_Thoai = CUtility.Convert_To_String(p_row["Dien_Thoai"]); } if (p_dt.Columns.Contains("Ma_So_Thue")) { p_objDes.Ma_So_Thue = CUtility.Convert_To_String(p_row["Ma_So_Thue"]); } if (p_dt.Columns.Contains("Created")) { p_objDes.Created = CUtility.Convert_To_DateTime(p_row["Created"]); } if (p_dt.Columns.Contains("Created_By")) { p_objDes.Created_By = CUtility.Convert_To_String(p_row["Created_By"]); } if (p_dt.Columns.Contains("Last_Updated")) { p_objDes.Last_Updated = CUtility.Convert_To_DateTime(p_row["Last_Updated"]); } if (p_dt.Columns.Contains("Last_Updated_By")) { p_objDes.Last_Updated_By = CUtility.Convert_To_String(p_row["Last_Updated_By"]); } if (p_dt.Columns.Contains("Deleted")) { p_objDes.Deleted = CUtility.Convert_To_Bool(p_row["Deleted"]); } }
private void _RebuildTileIcons() { CUtility.DestroyChildren(_tileIcons); for (int iX = 0; iX < _asset.mWidth * 2; ++iX) { for (int iY = 0; iY < _asset.mLength * 2; ++iY) { if (_asset.mTiles[iX, iY].mSolid) { GameObject gob = GameObject.CreatePrimitive(PrimitiveType.Quad); //GameObject gob = new GameObject(); gob.transform.SetParent(_tileIcons.transform); gob.transform.localPosition = new Vector3(iX * 0.5f + 0.25f, 0.0f, iY * 0.5f + 0.25f); gob.transform.rotation = Quaternion.Euler(90, 0, 0); gob.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); gob.GetComponent <MeshRenderer>().material = CGame.WorldResources.TileIconSolid; } } } for (int i = 0; i < _asset.mUsageSlots.Count; ++i) { CItemAsset.CUsageSlot s = _asset.mUsageSlots[i]; // Entry point tile hits Vector3 size = s.mEntrySize; Vector3 halfExtents = size * 0.5f; Vector3 min = s.mEntryPosition - halfExtents; Vector3 max = s.mEntryPosition + halfExtents; // Search for tiles within bounds int sX = (int)(min.x * 2.0f) - 1; int sY = (int)(min.z * 2.0f) - 1; int eX = (int)(max.x * 2.0f); int eY = (int)(max.z * 2.0f); for (int iX = sX; iX <= eX; ++iX) { for (int iY = sY; iY <= eY; ++iY) { Vector3 origin = new Vector3(iX * 0.5f + 0.25f, -0.01f, iY * 0.5f + 0.25f); if (origin.x >= min.x && origin.x <= max.x && origin.z >= min.z && origin.z <= max.z) { CDebug.DrawYSquare(origin, 0.45f, Color.blue, true); GameObject gob = GameObject.CreatePrimitive(PrimitiveType.Quad); //GameObject gob = new GameObject(); gob.transform.SetParent(_tileIcons.transform); gob.transform.localPosition = origin; gob.transform.rotation = Quaternion.Euler(90, 0, 0); gob.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); gob.GetComponent <MeshRenderer>().material = CGame.WorldResources.TileIconTrigger; } } } } }
public void Log() { CUtility.Log(string.Format("Candle {0} {1} {2}", this.Date.ToString(CultureInfo.InvariantCulture), Math.Round(this.Close, 4).ToString(CultureInfo.InvariantCulture), this.Color.ToString())); //CUtility.Log("Date : " + this.Date.ToString(CultureInfo.InvariantCulture)); //CUtility.Log("Bid : " + Math.Round(this.Close, 4).ToString(CultureInfo.InvariantCulture)); //CUtility.Log("Color : " + this.Color.ToString()); CUtility.Log(""); }
private void gridAPILog_RecordMouseDoubleClick(object sender, RoutedEventArgs e) { if (m_InProcess == false && CUtility.IsDataRecord(sender)) { btnDetails.PerformClick(); } }
private void _RebuildComponentView() { CUtility.DestroyChildren(_componentContent); /* * mUI.CreateTextElement(_componentContent, "Item Components", "text", CToolkitUI.ETextStyle.TS_HEADING); * * GameObject toolbar = mUI.CreateElement(_componentContent, "toolbarView"); * mUI.AddLayout(toolbar, -1, 48, 1.0f, -1); * mUI.AddImage(toolbar, mUI.WindowPanelBackground); * mUI.AddHorizontalLayout(toolbar); * toolbar.GetComponent<HorizontalLayoutGroup>().spacing = 4; * * mUI.CreateToolbarButton(toolbar, "Add Model", mUI.LevelImage, _AddModel); * mUI.CreateToolbarButton(toolbar, "Add Slot", mUI.LevelImage); * mUI.CreateToolbarButton(toolbar, "Duplicate", mUI.LevelImage); * mUI.CreateToolbarButton(toolbar, "Remove", mUI.LevelImage); * * GameObject scrollContent; * GameObject scrollV1 = mUI.CreateScrollView(_componentContent, out scrollContent, true); * mUI.AddLayout(scrollV1, -1, -1, 1.0f, 1.0f); * * CTUITreeView treeView; * GameObject treeViewGob = mUI.CreateTreeView(scrollContent, out treeView); * mUI.AddLayout(treeViewGob, -1, -1, 1.0f, 1.0f); * * CTUITreeViewItem tvCat = treeView.mRootItem.AddItem("Models"); * tvCat.mExpanded = true; * for (int i = 0; i < _asset.mModels.Count; ++i) * { * int index = i; * tvCat.AddItem("Model " + i.ToString(), () => { _SelectModel(index); }); * } * * tvCat = treeView.mRootItem.AddItem("Slots"); * tvCat.mExpanded = true; * for (int i = 0; i < _asset.mUsageSlots.Count; ++i) * { * CTUITreeViewItem tvSlot = tvCat.AddItem("Slot " + i.ToString()); * tvSlot.mExpanded = true; * * for (int j = 0; j < _asset.mUsageSlots[i].mEntrySlots.Count; ++j) * { * tvSlot.AddItem("Entry " + j); * } * } * * tvCat = treeView.mRootItem.AddItem("Item Specific"); * * if (_asset.mItemType == EItemType.DESK) * { * tvCat.AddItem("Chair"); * } * * tvCat.RebuildEntireTree(); */ }
private void LoadGroupTableLua(string sFileName) { m_pGroupTable = CUtility.BuildGroupTable(sFileName); if (null != m_pGroupTable) { GroupTableTitle.text = "Group Table:\n" + sFileName; Debug.Log(m_pGroupTable.GetGroupTableDesc()); m_pCalcs[(int)m_eCalcType].SetGroupTable(m_pGroupTable); } }
public override void Deserialize(BinaryReader R) { base.Deserialize(R); int version = R.ReadInt32(); if (version == 4 || version == 5) { mBackgroundColor.r = R.ReadSingle(); mBackgroundColor.g = R.ReadSingle(); mBackgroundColor.b = R.ReadSingle(); for (int iX = 0; iX < 100; ++iX) { for (int iY = 0; iY < 100; ++iY) { Color32 tileCol; tileCol.r = R.ReadByte(); tileCol.g = R.ReadByte(); tileCol.b = R.ReadByte(); tileCol.a = 255; mTileColors[iX, iY] = tileCol; mWallX[iX, iY] = R.ReadInt32(); mWallZ[iX, iY] = R.ReadInt32(); } } } if (version == 5) { mObjects.Clear(); int metaCount = R.ReadInt32(); for (int i = 0; i < metaCount; ++i) { CLevelMetaObject meta = new CLevelMetaObject(); mObjects.Add(meta); meta.mID = R.ReadInt32(); meta.mType = (CLevelMetaObject.EType)R.ReadInt32(); meta.mSubtype = R.ReadInt32(); meta.mOwner = R.ReadInt32(); meta.mIdentifier = R.ReadString(); meta.mData = R.ReadInt32(); meta.mPositionA = CUtility.ReadVec3(R); meta.mPositionB = CUtility.ReadVec3(R); meta.mRotation = R.ReadInt32(); meta.mOrientation = CUtility.ReadVec3(R); meta.mExtraIntData = R.ReadInt32(); meta.mExtraFloatData = R.ReadSingle(); meta.mExtraBoolData = R.ReadBoolean(); meta.mColor = CUtility.ReadColor(R); } } }
public void Print() { CUtility.Log("money : " + Money.ToString(CultureInfo.InvariantCulture)); CUtility.Log("coins : " + Coins.ToString(CultureInfo.InvariantCulture)); CUtility.Log("coinvalue : " + Coinvalue.ToString(CultureInfo.InvariantCulture)); CUtility.Log("value : " + Value.ToString(CultureInfo.InvariantCulture)); CUtility.Log("i : " + i.ToString(CultureInfo.InvariantCulture)); CUtility.Log("j : " + j.ToString(CultureInfo.InvariantCulture)); CUtility.Log("w : " + w.ToString(CultureInfo.InvariantCulture)); CUtility.Log("k : " + k.ToString(CultureInfo.InvariantCulture)); }
public void RandomMove() { Vector3 EndPos = gameObject.transform.position + new Vector3(UnityEngine.Random.Range(-1.0f, 1.0f), UnityEngine.Random.Range(-1.0f, 1.0f), 0.0f); EndPos = CUtility.RoundVector3(EndPos); bool bMove = Move(gameObject.transform.position, EndPos); if (bMove) { curState = EState.Move; } }