void Awake() { m_begTouPos = Vector3.zero; m_isTou = false; m_numManager = GameObject.FindGameObjectWithTag("Numbers").GetComponent <NumberManager>(); }
/// <summary> /// 保持データ通知コマンドを処理する。 /// </summary> /// <param name="command">保持データ通知コマンド</param> private void ProcessTransferCommand(Command command) { try { // 自分のデータについての通知は無視 if (command.AuthorID == client.ID) { return; } // 送信要求を出していないものがあれば送信要求コマンドを送り返す TcpConnection connection = GetConnection(command.SourceID); NumberManager numberManager = GetNumberManager(command.AuthorID); numberManager.SetFloorNumber(long.Parse(command.PhotoName)); long limit = command.SerialNumber; long requestNumber; while ((requestNumber = numberManager.NextRequestNumber(limit)) > 0) { connection.Send(Command.CreateRequestCommand( requestNumber, command.AuthorID, client.ID)); } } catch (Exception e) { PhotoChat.WriteErrorLog(e.ToString()); } }
//public GameObject bonusCanvas; void Start() { i = 0; maxNum = 41; numMan = GameObject.Find("ScriptHolder").GetComponent <NumberManager> (); bonusMan = GameObject.Find("ScriptHolder").GetComponent <BonusManager>(); numGenClass = GameObject.Find("ScriptHolder").GetComponent <GenerationOfNumbers>(); }
// Start is called before the first frame update void Start() { m_NumberManager = GameObject.Find("Main Camera").GetComponent <NumberManager>() as NumberManager; m_Checkbox = GameObject.Find("Checkbox").GetComponent <Checkbox>() as Checkbox; m_GameData = GameObject.Find("GameDataObject").GetComponent <CurrentGameData>() as CurrentGameData; m_SurvivalHearts = GameObject.Find("Main Camera").GetComponent <SurvivalHearts>() as SurvivalHearts; m_Scores = GameObject.Find("Main Camera").GetComponent <Scores>() as Scores; }
public void Start() { graphic = GetComponent <Graphic>(); defcolor = graphic.color; NB = GameObject.Find("NumberManager").GetComponent <NumberManager>(); pushedNumber = int.Parse(this.gameObject.name); }
public void Awake() { singleton = this; yourTurn.text = ""; bottomScoreText.text = remoteScore.ToString(); topScoreText.text = localScore.ToString(); Debug.Log("NumberManager Awake()"); }
public void AddHeart(long v) { GameObject h = Instantiate(_getHeartText, _heartText.transform.parent.transform.parent.transform); h.transform.Find("Heart").GetComponent <Text>().text = "+" + NumberManager.NtoS(v); _realHeart += v; dm.SetHeartPoint(_realHeart); RefreshRealHeart(); }
public static void EffectText(string name, Vector2 pos, string text) { if (Instance) { NumberManager number = Instantiate(Instance._effects[name], pos, Quaternion.identity).GetComponent <NumberManager>(); if (number) { number.ChangeText(text); } } }
void GetInstance() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(gameObject); } }
//For Button Init void InitUpgradeBtnUI() { _upgradeBtnUI[0].transform.Find("Upgrade1Btn/Need").GetComponent <Text>().text = NumberManager.NtoS(GetNextTouchLvNeed(dm.GetTouchLv())) + ""; _upgradeBtnUI[0].transform.Find("Lv").GetComponent <Text>().text = "Lv. " + dm.GetTouchLv() + ""; _upgradeBtnUI[0].transform.Find("Info").GetComponent <Text>().text = "+" + GetTouchLvValue() + "글자 /"; _upgradeBtnUI[1].transform.Find("Upgrade2Btn/Need").GetComponent <Text>().text = NumberManager.NtoS(GetNextHeartGetLvNeed(dm.GetHeartGetPerTouchLv())) + ""; _upgradeBtnUI[1].transform.Find("Lv").GetComponent <Text>().text = "Lv. " + dm.GetHeartGetPerTouchLv() + ""; _upgradeBtnUI[1].transform.Find("Info").GetComponent <Text>().text = "+" + NumberManager.NtoS(GetHeartGetValue()) + " /"; _upgradeBtnUI[2].transform.Find("Upgrade3Btn/Need").GetComponent <Text>().text = NumberManager.NtoS(GetNextHeartAutoGetLvNeed(dm.GetHeartAutoGetPerTimeLv())) + ""; _upgradeBtnUI[2].transform.Find("Lv").GetComponent <Text>().text = "Lv. " + dm.GetHeartAutoGetPerTimeLv() + ""; _upgradeBtnUI[2].transform.Find("Info").GetComponent <Text>().text = "+" + NumberManager.NtoS(GetHeartAutoGetValue()) + " /"; }
public void StageReseted() { StopAttack(); if (DataManager._dm != null) { _bibleEnergy = System.Convert.ToInt64(10 + DataManager._dm.GetBibleEnergyPerAbility(_abilityCode) * 0.2); } else { _bibleEnergy = 10L; } _beText.text = "+" + NumberManager.NtoS(_bibleEnergy) + ""; _abilityAttackCount = _abilityAttackCountMax; _acText.text = _abilityAttackCount + ""; _spring.connectedAnchor = _startPos; }
public virtual void Awake() { tokenTypes = (UnityEngine.Object[])Resources.LoadAll("Tokens/"); noteSprites = Resources.LoadAll <Sprite>("Sprites/Note sprites"); gridArray = new GameObject[gridWidth, gridHeight]; matchManager = GetComponent <MatchManagerScript>(); inputManager = GetComponent <InputManagerScript>(); repopulateManager = GetComponent <RepopulateScript>(); moveTokenManager = GetComponent <MoveTokensScript>(); numberManager = GetComponent <NumberManager>(); stringGraphic = Resources.Load("String") as GameObject; timeBetweenBeats = 60.0f / bpm; music = GameObject.Find(SPEAKER_OBJ).GetComponent <AudioSource>(); healthText = transform.root.Find(UI_CANVAS).Find(HEALTH_TEXT).GetComponent <Text>(); MakeGrid(); ChangeGridDuplicates(); }
void Start() { canvasRoot = GameObject.Find("Root"); connectionRoot = GameObject.Find("TestConnection"); textRoot = GameObject.Find("TextManager"); numberRoot = GameObject.Find("NumberManager"); alertRoot = GameObject.Find("AlertManager"); audioRoot = canvasRoot.GetComponent <AudioSource>(); DOTween.Init(); //简单初始化DOTween UIManager.InitUIDic(); //初始化保存UI的数据字典 NumberManager.InitNumberResource(); //初始化NumberManager所需要的纹理资源 CVector.InitVector3(); //初始化Vector3配置信息 gameState = GameState.GameState_ENTRY; }
public Poem WritePoem() { List <string> body = new List <string>(); var numManager = new NumberManager(); for (int i = 0; i < 5; i++) { Line line = new Line(numManager); body.Add(line.Generate()); } var poem = new Poem() { Title = "Title", Body = body }; return(poem); }
private void Start() { if (DataManager._dm != null) { _bibleEnergy = System.Convert.ToInt64(10 + DataManager._dm.GetBibleEnergyPerAbility(_abilityCode) * 0.2); } else { _bibleEnergy = 10L; } _beText = transform.Find("AbilityUI/Info/Text").GetComponent <Text>(); _beText.text = "+" + NumberManager.NtoS(_bibleEnergy) + ""; _gameCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); _attackDelay = _attackDelayList[_abilityCode - 1]; _attackSlider.GetComponent <Slider>().maxValue = _attackDelay; _attackType = transform.Find("AbilityUI/AttackType").GetComponent <CanvasGroup>(); _abilityAttackCountMax = _abilityAttackCount; _acText = transform.Find("AbilityUI/AttackCount/Text").GetComponent <Text>(); _acText.text = _abilityAttackCount + ""; _attackCountImage = _acText.transform.parent.GetComponent <Image>(); }
/// <summary> /// IDに対応するNumberManagerを返す。 /// 新しいIDであればNumberManagerを作成して返す。 /// </summary> /// <param name="id">ID</param> /// <returns>IDに対応するNumberManager</returns> private NumberManager GetNumberManager(string id) { NumberManager numberManager = null; try { lock (numberDictionary) { if (!numberDictionary.TryGetValue(id, out numberManager)) { numberManager = new NumberManager(id); numberDictionary[id] = numberManager; } } } catch (Exception e) { PhotoChat.WriteErrorLog(e.ToString()); } return(numberManager); }
public CalculationViewModel() { Element1 = "0"; DisplayText = ""; CurrentFunction = ""; isResult = isClear = false; previousStyle = ButtonStyle.NONE; numberManager = new NumberManager(); displayManager = new DisplayManager(); InitializeDisplayValueCommand(); InitializeTransformSignCommand(); InitializeUnaryCalculationCommand(); InitializeBinaryCalculationCommand(); InitializeDecimalCommand(); InitializeDeleteCommand(); InitializeResultCommand(); InitializeMCCommand(); InitializeMRCommand(); InitializeMPlusCommand(); InitializeMSubtractCommand(); InitializeMSCommand(); }
//public GameObject bonusCanvas; void Start() { i = 0; maxNum = 40; numMan = GameObject.Find ("ScriptHolder").GetComponent<NumberManager> (); bonusMan = GameObject.Find("ScriptHolder").GetComponent<BonusManager>(); numGenClass = GameObject.Find("ScriptHolder").GetComponent<GenerationOfNumbers>(); }
public void HeartAutoGetUpgrade() { if (gm.GetRealHeart() >= GetNextHeartAutoGetLvNeed(dm.GetHeartAutoGetPerTimeLv())) { gm.UseHeart(GetNextHeartAutoGetLvNeed(dm.GetHeartAutoGetPerTimeLv())); gm.RefreshRealHeart(); dm.SetHeartAutoGetPerTimeLv(1); _upgradeBtnUI[2].transform.Find("Upgrade3Btn/Need").GetComponent <Text>().text = NumberManager.NtoS(GetNextHeartAutoGetLvNeed(dm.GetHeartAutoGetPerTimeLv())) + ""; _upgradeBtnUI[2].transform.Find("Lv").GetComponent <Text>().text = "Lv. " + dm.GetHeartAutoGetPerTimeLv() + ""; _upgradeBtnUI[2].transform.Find("Info").GetComponent <Text>().text = "+" + NumberManager.NtoS(GetHeartAutoGetValue()) + " /"; if (dm.GetHeartAutoGetPerTimeLv() % 10 == 0) { _upgradeBtnUI[2].transform.Find("subInfo").GetComponent <Text>().text = GetHeartAutoGetTime() + "초"; } am.UpdgradeActionPlay(0); } }
public void HeartGetUpgrade() { if (gm.GetRealHeart() >= GetNextHeartGetLvNeed(dm.GetHeartGetPerTouchLv())) { gm.UseHeart(GetNextHeartGetLvNeed(dm.GetHeartGetPerTouchLv())); gm.RefreshRealHeart(); dm.SetHeartGetPerTouchLv(1); _upgradeBtnUI[1].transform.Find("Upgrade2Btn/Need").GetComponent <Text>().text = NumberManager.NtoS(GetNextHeartGetLvNeed(dm.GetHeartGetPerTouchLv())) + ""; _upgradeBtnUI[1].transform.Find("Lv").GetComponent <Text>().text = "Lv. " + dm.GetHeartGetPerTouchLv() + ""; _upgradeBtnUI[1].transform.Find("Info").GetComponent <Text>().text = "+" + NumberManager.NtoS(GetHeartGetValue()) + " /"; am.UpdgradeActionPlay(0); } }
public void RefreshRealBibleEnergy() { _bibleEnergyText.text = NumberManager.NtoS(_realBibleEnergy); }
public virtual void OnDrop(PointerEventData eventData) { // // commented Debug.Log("drop."); if (DragHandler.itemBeingDragged == item) { // commented Debug.Log("Dropped item onto the same location in inventory"); return; } AnalyticsManager.inst.RecordEvent(AnalyticsManager.Keys.timesItemDroppedOnInventorySlot, 1); // Does it pass the type check? GameObject draggedItem3d = DragHandler.itemBeingDragged.GetComponent <InventoryItem>().item3d; NumberInfo ni = draggedItem3d.GetComponent <NumberInfo>(); Gadget gp = null; if (item && item.GetComponent <InventoryItem>() && item.GetComponent <InventoryItem>().item3d.GetComponentInChildren <Gadget>()) { gp = item.GetComponent <InventoryItem>().item3d.GetComponentInChildren <Gadget>(); } Gadget gad = draggedItem3d.GetComponent <Gadget>(); ClothingArmor ca = draggedItem3d.GetComponent <ClothingArmor>(); ClothingBoots cb = draggedItem3d.GetComponent <ClothingBoots>(); ClothingHat ch = draggedItem3d.GetComponent <ClothingHat>(); if (draggedItem3d.GetComponent <PickUppableObject>().itemType == ItemType.Hat && !allowHat) { return; } if ((ni && !allowNumbers) || (gad && !allowGadgets) || (ca && !allowArmor) || (cb && !allowBoots) || (ch && !allowHat)) { return; } // else Debug.Log(" allowed! gadg?:"+gp+", allowgad:"+allowGadgets); // // commented Debug.Log("gp:"+gp); // If we successfully dropped a number onto the equipped empty hand int thisBeltIndex = -1; for (int i = 0; i < Inventory.inst.beltSlots.Length; i++) { if (this == Inventory.inst.beltSlots[i]) { thisBeltIndex = i; // if (Inventory.inst.CompareSlot(Inventory.inst.beltSlots[thisBeltIndex],Inventory.inst.beltSlots[Inventory.inst.selectedIndex])){ // // } } } if (item) { // dropped one item onto another if (ni && !NumberManager.IsCombineable(ni)) { return; //SwapItems(item,draggedItem3d); } // NumberManager.IsCombineable(ni)) NumberInfo ni2 = item.GetComponent <InventoryItem>().item3d.GetComponent <NumberInfo>(); if (ni2 && !NumberManager.IsCombineable(ni2)) { return; //SwapItems() } if (ni && ni2) // Dragged one number onto another { Fraction result = Fraction.Add(ni.fraction, ni2.fraction); // Debug.Log("drag successful:"+ni.fraction+" dragged to "+ni2.fraction+"="+result); if (result.numerator == 0) { ni.ZeroFX(ni.transform.position); PlayerGadgetController.inst.GetCurrentGadget().CheckAmmoNull(ni2.gameObject, result); Destroy(draggedItem3d); Destroy(DragHandler.itemBeingDragged); Destroy(item); AudioManager.inst.PlayNumberShatter(Player.inst.transform.position); EffectsManager.inst.CreateShards(Player.inst.transform.position + Player.inst.transform.forward * 3 + Player.inst.transform.up); return; } ni2.SetNumber(result); item.GetComponent <InventoryItem>().SetUpDigits(ni2); if (PlayerGadgetController.inst.ThrowGadgetEquipped()) { PlayerGadgetController.inst.GetCurrentGadget().UpdateAmmoGraphics(); } SinGrowFX(item); AudioManager.inst.PlayNumberEat(Player.inst.transform.position); ExecuteEvents.ExecuteHierarchy <IHasChanged>(gameObject, null, (x, y) => x.HasChanged()); Destroy(draggedItem3d); Destroy(DragHandler.itemBeingDragged); } if (gp) { // Dropped a number onto a gadget. if (ni && !NumberManager.IsCombineable(ni)) { return; // don't allow gadget to collect invalid numbers. } // Debug.Log("dropped:"+ni.fraction+"o onto:"+gp); // gp.DropAmmo(); if (gp.IsValidAmmo(ni.gameObject)) { gp.DropAmmo(); SinGrowFX(item); gp.OnCollectItem(ni.gameObject); // Debug.Log("gadget "+gp.myName+"collected:"+ni.gameObject); AudioManager.inst.PlayNumberEat(Player.inst.transform.position); ExecuteEvents.ExecuteHierarchy <IHasChanged>(gameObject, null, (x, y) => x.HasChanged()); // Destroy(draggedItem3d); // this is handled in the gadget's oncollect method, some gadgets do not destroy the number but set it directly as the numberheld e.g. wavegadget // Debug.Log("finishing drag of item3d:"+draggedItem3d+" and itembeingdragged;"+DragHandler.itemBeingDragged); Destroy(DragHandler.itemBeingDragged); } else { } } } else // if(!item){ // dropped onto an empty slot. { DragHandler.itemBeingDragged.transform.SetParent(transform); // Debug.Log("set "+DragHandler.itemBeingDragged+" to "+transform+" parent"); // ExecuteEvents.ExecuteHierarchy<IHasChanged>(gameObject,null,(x,y) => x.HasChanged ()); // prevent the item from returning to original slot maybe? } // If we dragged something to the belt space we had selected, then reselect it to update that space. // if (Inventory.inst.ThisSpaceSelected(this)){ // Inventory.inst.SelectSpace(this); // // // commented Debug.Log("Hi"); // // Inventory.inst.SelectBeltSpace(Inventory.inst.selectedIndex); // } Inventory.inst.UpdateBeltSelection(); }
private void StrongBE(long v) { _bibleEnergy += v; _beText.text = "+" + NumberManager.NtoS(_bibleEnergy) + ""; }
public void RefreshRealHeart() { _heartText.text = NumberManager.NtoS(_realHeart); }
public void SetInstance() { inst = this; }
void Start() { i = 0; source = GetComponent <AudioSource>(); numMan = GameObject.Find("ScriptHolder").GetComponent <NumberManager> (); }
public void SetText(long damage) { DamageText.text = NumberManager.NtoS(damage); }
void Start() { NB = GameObject.Find("NumberManager").GetComponent <NumberManager>(); }
private void Awake() { Instance = this; }
void Awake() { instance = this; }
void Start() { i = 0; source = GetComponent<AudioSource>(); numMan = GameObject.Find ("ScriptHolder").GetComponent<NumberManager> (); }