コード例 #1
0
    void Awake()
    {
        m_begTouPos = Vector3.zero;
        m_isTou     = false;

        m_numManager = GameObject.FindGameObjectWithTag("Numbers").GetComponent <NumberManager>();
    }
コード例 #2
0
        /// <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());
            }
        }
コード例 #3
0
    //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>();
    }
コード例 #4
0
 // 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;
 }
コード例 #5
0
ファイル: PushPanel.cs プロジェクト: sia1106/simpleNback
    public void Start()
    {
        graphic  = GetComponent <Graphic>();
        defcolor = graphic.color;

        NB           = GameObject.Find("NumberManager").GetComponent <NumberManager>();
        pushedNumber = int.Parse(this.gameObject.name);
    }
コード例 #6
0
 public void Awake()
 {
     singleton            = this;
     yourTurn.text        = "";
     bottomScoreText.text = remoteScore.ToString();
     topScoreText.text    = localScore.ToString();
     Debug.Log("NumberManager Awake()");
 }
コード例 #7
0
    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();
    }
コード例 #8
0
ファイル: EffectManager.cs プロジェクト: TBTBTBT/RPG_Utility
 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);
         }
     }
 }
コード例 #9
0
 void GetInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #10
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     if (instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #11
0
ファイル: LevelManager.cs プロジェクト: Curookie/Portfolio
    //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()) + " /";
    }
コード例 #12
0
 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;
 }
コード例 #13
0
 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();
 }
コード例 #14
0
ファイル: GameEntry.cs プロジェクト: Rayzxy123/MySelf
    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;
    }
コード例 #15
0
        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);
        }
コード例 #16
0
 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>();
 }
コード例 #17
0
        /// <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);
        }
コード例 #18
0
        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();
        }
コード例 #19
0
 //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>();
 }
コード例 #20
0
ファイル: LevelManager.cs プロジェクト: Curookie/Portfolio
 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);
     }
 }
コード例 #21
0
ファイル: LevelManager.cs プロジェクト: Curookie/Portfolio
 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);
     }
 }
コード例 #22
0
 public void RefreshRealBibleEnergy()
 {
     _bibleEnergyText.text = NumberManager.NtoS(_realBibleEnergy);
 }
コード例 #23
0
    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();
    }
コード例 #24
0
 private void StrongBE(long v)
 {
     _bibleEnergy += v;
     _beText.text  = "+" + NumberManager.NtoS(_bibleEnergy) + "";
 }
コード例 #25
0
 public void RefreshRealHeart()
 {
     _heartText.text = NumberManager.NtoS(_realHeart);
 }
コード例 #26
0
 public void SetInstance()
 {
     inst = this;
 }
コード例 #27
0
ファイル: BalloonPop.cs プロジェクト: RafaelMunoz/CollorPop
 void Start()
 {
     i      = 0;
     source = GetComponent <AudioSource>();
     numMan = GameObject.Find("ScriptHolder").GetComponent <NumberManager> ();
 }
コード例 #28
0
ファイル: DamageCtrl.cs プロジェクト: Curookie/Portfolio
 public void SetText(long damage)
 {
     DamageText.text = NumberManager.NtoS(damage);
 }
コード例 #29
0
 void Start()
 {
     NB = GameObject.Find("NumberManager").GetComponent <NumberManager>();
 }
コード例 #30
0
 private void Awake()
 {
     Instance = this;
 }
コード例 #31
0
ファイル: NumberManager.cs プロジェクト: SergioRibera/Pop
 void Awake()
 {
     instance = this;
 }
コード例 #32
0
ファイル: BalloonPop.cs プロジェクト: RafaelMunoz/CollorPop
 void Start()
 {
     i = 0;
     source = GetComponent<AudioSource>();
     numMan = GameObject.Find ("ScriptHolder").GetComponent<NumberManager> ();
 }