Esempio n. 1
0
        public void Add(int type, int value, bool isMerge = true)
        {
            if (!this.tasks.ContainsKey(type.ToString()))
            {
                return;
            }
            LocalData localData = this.tasks[type.ToString()];

            if (isMerge)
            {
                localData.value += value;
            }
            else
            {
                localData.value = value;
            }
            this.tasks[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            GlobalEventHandle.EmitRefreshTaskHandle(type);
            if (localData.status != -1)
            {
                return;
            }
            TTask tTask = Configs.Configs.TTasks[localData.key.ToString()];

            if (localData.value >= tTask.Value)
            {
                localData.status = -2;
            }
            this.tasks[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            DotManager.GetInstance().CheckTask();
            GlobalEventHandle.EmitRefreshTaskHandle(type);
        }
        public void Update()
        {
            if (GM.GetInstance().GameId != 0)
            {
                this.m_gameMiniTime += Time.deltaTime;
            }
            this.m_gameTotalTime += Time.deltaTime;
            AdsManager.GetInstance().Update();
            if ((DateTime.Now - GlobalTimer.m_instance.m_saveTimer).Days == 0)
            {
                return;
            }
            GlobalTimer.m_instance.m_saveTimer = DateTime.Now;
            GlobalTimer.m_instance.SaveTime();
            TaskData.GetInstance().Reset();
            Action expr_82 = this.RefreshHandle;

            if (expr_82 != null)
            {
                expr_82();
            }
            GoodsManager.GetInstance().Reset();
            LoginData.GetInstance().RunSerialDay();
            DotManager.GetInstance().Check();
            GM.GetInstance().ResetSkinFreeTime();
            GM.GetInstance().ResetFirstShare(0);
        }
Esempio n. 3
0
    void CreateTriangle()
    {
        int value = 1;
        int sign  = 1;

        for (int i = 0; i < numberDotsOnCircle; i++)
        {
            CircleBorder.rotation = Quaternion.Euler(new Vector3(0, 0, ((float)i) * 360f / numberDotsOnCircle));

            if (value > 3)
            {
                sign = -1;
            }

            if (value < 2)
            {
                sign = 1;
            }

            DotManager dm = poolSystem.SpawnSquare(pos * 5 / (5 + value), rot, parent);

            value += sign;

            LIST_SQUARE.Add(dm);
        }
    }
Esempio n. 4
0
    void CreateParralax(int decal, int gap, int parralaxLength)
    {
        for (int i = 0; i < numberDotsOnCircle; i++)
        {
            float variable = 1;

            if (Level % 5 > 3)
            {
                if (i % 2 == 0)
                {
                    variable = 0.8f - ((Level % 2) / 10f);
                }
                else
                {
                    variable = 1f - ((Level % 2) / 10f);;
                }
            }

            CircleBorder.rotation = Quaternion.Euler(new Vector3(0, 0, ((float)i) * 360f / numberDotsOnCircle));

            DotManager dm = poolSystem.SpawnSquare(variable * pos * parralaxLength * decal / (parralaxLength * decal + gap * i % parralaxLength), rot, parent);

            LIST_SQUARE.Add(dm);
        }
    }
Esempio n. 5
0
    /// <summary>
    /// Method to shoot the first dot and moving the other. This method check if the list of dots to shoot is empty or not. If the list is empty, this method triggered the success for this level.
    /// </summary>
    void ShootDot(DotManager d)
    {
        StopCoroutine("PositioningDots");
        StopCoroutine("MoveStartPositionDot");


        for (int i = 0; i < Dots.Count; i++)
        {
            Dots [i].transform.DOKill();
        }


        for (int i = 0; i < Dots.Count; i++)
        {
            if (!Dots[i].isMoving)
            {
                Dots [i].transform.position = new Vector3(0, -GetPositionYTarget() + (-i - 1) * sizeDot, Dots [i].transform.position.z);
            }
        }

        PlaySoundBeep();

        Dots.Remove(d);

        if (this.lastShoots == null)
        {
            this.lastShoots = new List <DotManager> ();
        }

        this.lastShoots.Add(d);


        Vector3 target = new Vector3(d.transform.position.x, SpriteCircle.position.y - 1, d.transform.position.z);

        d.transform.position = new Vector3(0, -GetPositionYTarget() + (-0 - 1) * sizeDot, d.transform.position.z);

        d.isMoving = true;



        d.Shoot();


        for (int i = 0; i < Dots.Count; i++)
        {
            if (sizeDot == 0)
            {
                Debug.Log("!!!!!! GET SIZEDOT ( must be done just one time only)");
                sizeDot = Dots [0].DotSprite.bounds.size.x * 1.1f;
            }


            if (!Dots[i].isMoving)
            {
                Dots [i].transform.DOMoveY(-GetPositionYTarget() + (-i - 1) * sizeDot, 0.3f)
                .OnComplete(() => {
                });
            }
        }
    }
Esempio n. 6
0
    private void Awake()
    {
        GetComponents(_gameManagers);

        GameObject playerOne = Instantiate(_playerPrefab);
        GameObject playerTwo = Instantiate(_playerPrefab);

        playerOne.GetComponent <Player>().PlayerNumber = 1;
        playerTwo.GetComponent <Player>().PlayerNumber = 2;
        playerTwo.AddComponent(typeof(EnemyAI));

        foreach (IGameManager manager in _gameManagers)
        {
            manager.StartGame();
        }

        DotManager dotManager = GetComponent <DotManager>();

        playerOne.GetComponent <PlayerMovement>().SetStartPosition(dotManager.GetStartDot(1));
        playerTwo.GetComponent <PlayerMovement>().SetStartPosition(dotManager.GetStartDot(2));

        _playerOneMovement = GetComponent <PlayerMovement>();
        _playerTwoMovement = GetComponent <PlayerMovement>();

        GetComponent <TurnManager>().StartFirstTurn();
    }
Esempio n. 7
0
    void CreateDotOnCircle()
    {
        canShoot = false;

        Transform  prefab = this.DotPrefab;
        Vector3    pos    = new Vector3(0, -positionTouchBorder, -2);
        Quaternion rot    = prefab.rotation;
        Transform  parent = container;


        for (int i = 0; i < numberDotsOnCircle; i++)
        {
            containerParent.transform.rotation = Quaternion.Euler(new Vector3(0, 0, ((float)i) * 360f / numberDotsOnCircle));

            Transform t = Instantiate(prefab) as Transform;
            t.position = pos;
            t.rotation = rot;
            t.parent   = parent;

            DotManager dm = t.GetComponent <DotManager> ();

            dm.ActivateTrail();
        }

        SmoothDecal();
    }
Esempio n. 8
0
 public Tower(TowerBase towerBase, Faction faction, int _towerNum)
 {
     sections = new List<Section>();
     dotManager = new DotManager();
     this.towerBase = towerBase;
     this.faction = faction;
     towerNum = _towerNum;
 }
Esempio n. 9
0
        private async Task <bool> VenomousBite()
        {
            if (!ShinraEx.Settings.BardUseDots || Target.HasAura(VenomDebuff, true, 4000) || !await MySpells.VenomousBite.Cast())
            {
                return(false);
            }

            DotManager.Add(Target);
            return(true);
        }
Esempio n. 10
0
        public async Task <bool> Windbite()
        {
            if (!Shadow.Settings.BardUseDots || Target.HasAura(WindDebuff, true, 4000) || !await Spellbook.Windbite.Cast())
            {
                return(false);
            }

            DotManager.Add(Target);
            return(true);
        }
Esempio n. 11
0
        public void OnEnable()
        {
            InitializeStimuli();
            InitializeFixationDot();
            _innerStimulusManager = innerStimulus.GetComponent <DotManager>();
            _partition            = new AperturePartition(sessionSettings, _outerStimulusSettings, _innerStimulusSettings);
            StaircaseManager      = new StaircaseManager(sessionSettings);
            SetEnforcedHeadTransform();

            confirmInputAction[inputSource].onStateUp += GetUserSelection;
        }
Esempio n. 12
0
        private async Task <bool> IronJaws()
        {
            if (!Target.HasAura(VenomDebuff, true) || !Target.HasAura(WindDebuff, true) ||
                Target.HasAura(VenomDebuff, true, 5000) && Target.HasAura(WindDebuff, true, 5000) || !await MySpells.IronJaws.Cast())
            {
                return(false);
            }

            DotManager.Add(Target);
            return(true);
        }
Esempio n. 13
0
 // Start is called before the first frame update
 void Start()
 {
     livesList = new List <GameObject>();
     spawning  = FindObjectOfType <DotManager>();
     totalDots = 241;
     lives     = 3;
     endtimes  = 3;
     livesList.Add(life1);
     livesList.Add(life2);
     livesList.Add(life3);
     StartCoroutine(StartGame());
 }
Esempio n. 14
0
    void CreateSpiral()
    {
        for (int i = 0; i < numberDotsOnCircle; i++)
        {
            CircleBorder.rotation = Quaternion.Euler(new Vector3(0, 0, ((float)i) * 360f / numberDotsOnCircle));

            float var = 1;

            DotManager dm = poolSystem.SpawnSquare(pos * (100f - var * i) / 100f, rot, parent);

            LIST_SQUARE.Add(dm);
        }
    }
Esempio n. 15
0
    /// <summary>
    /// Display particle when we distroy a square
    /// </summary>
    public void SpawnParticleExplosionSquare(DotManager square)
    {
        poolSystem.SpawnParticle(square.transform.position, Quaternion.identity);
        poolSystem.SpawnWave(square.transform.position, Quaternion.identity);

        soundManager.PlaySoundBeep();

        if (poolSystem.gameObject.activeInHierarchy)
        {
            poolSystem.DespawnSquare(square);
        }

        CheckIfSuccess();
    }
Esempio n. 16
0
        public static void Initialize()
        {
            Pass = RenderPass.None;
            Renderable_Solids       = new Renderable[0];
            Renderable_Transparents = new Renderable[0];
            Renderable_Posts        = new Renderable[0];
            Renderable_Shadows      = new Renderable[0];

            Buffer = new Buffer(Display.device, Utilities.SizeOf <GlobalConstant>(), ResourceUsage.Dynamic, BindFlags.ConstantBuffer, CpuAccessFlags.Write, ResourceOptionFlags.None, 0);

            //Debug
            DotManager  = new DotManager();
            LineManager = new LineManager();
            Add(DotManager);
            Add(LineManager);
        }
Esempio n. 17
0
        private async Task <bool> PitchPerfect()
        {
            if (!ShinraEx.Settings.BardPitchPerfect)
            {
                return(false);
            }

            var critBonus = DotManager.Check(Target, true);

            if (NumRepertoire >= ShinraEx.Settings.BardRepertoireCount || MinuetActive && SongTimer < 2000 ||
                critBonus >= 20 && NumRepertoire >= 2)
            {
                return(await MySpells.PitchPerfect.Cast());
            }
            return(false);
        }
Esempio n. 18
0
 public void Reload()
 {
     this.InitializeGameConfig();
     Configs.LoadConfig();
     GM.GetInstance().Init();
     GoodsManager.Initialize();
     AchiveData.Initialize();
     TaskData.Initialize();
     LoginData.Initialize();
     GlobalTimer.Initialize();
     AdsManager.Initialize();
     DotManager.GetInstance().Check();
     GameList.Instance.init();
     GetComponent <MainScene>().Init();
     Utils.ShowLoginRewards();
 }
Esempio n. 19
0
        public void Update()
        {
            if (this.m_isWatch)
            {
                return;
            }
            this.RefreshRewardTime();
            int num = (int)Math.Ceiling((double)(600f - this.m_stimulateTimer));

            if (num <= 0)
            {
                this.m_isWatch        = true;
                this.m_stimulateTimer = 0f;
                DotManager.GetInstance().CheckAds();
            }
            GlobalEventHandle.EmitAdsHandle(string.Format("{0:D2}:{1:D2}", num / 60, num % 60), this.m_isWatch);
        }
Esempio n. 20
0
    private void Start()
    {
#if UNITY_EDITOR
        this.InitializeGameConfig();
        Configs.LoadConfig();
        GM.GetInstance().Init();
        GoodsManager.Initialize();
        AchiveData.Initialize();
        TaskData.Initialize();
        LoginData.Initialize();
        GlobalTimer.Initialize();
        AdsManager.Initialize();
        DotManager.GetInstance().Check();
        GameList.Instance.init();
        GetComponent <MainScene>().Init();
        Utils.ShowLoginRewards();
#endif
    }
Esempio n. 21
0
    void CreateListDots()
    {
        canShoot   = false;
        DotsBottom = new List <DotManager>();
        DotsTop    = new List <DotManager>();

        if (sizeDot == 0)
        {
            DotManager dm = InstantiateDot();


            sizeDot = dm.DotSprite.bounds.size.x;
        }

        float numberBOTTOM = numberDotsToCreate * rationNombreDotsToCreatBottom;

        for (int i = 0; i < numberBOTTOM; i++)
        {
            DotManager dm = InstantiateDot();
            dm.GetComponent <Collider2D>().enabled = false;

            dm.transform.position = getDotPositionBottom(i);


            DotsBottom.Add(dm);
        }

        float numberTOP = numberDotsToCreate * rationNombreDotsToCreatTop;

        for (int i = 0; i < numberTOP; i++)
        {
            DotManager dm = InstantiateDot();
            dm.GetComponent <Collider2D>().enabled = false;



            dm.transform.position = getDotPositionTop(i);


            DotsTop.Add(dm);
        }
    }
Esempio n. 22
0
    /// <summary>
    /// To anim in and out the rotating dots
    /// </summary>
    IEnumerator SmoothDecalRoutine(DotManager d)
    {
        bool goIn = true;

        float distance = Vector3.Distance(d.transform.position, containerParent.transform.position);

        while (true)
        {
            if (d == null)
            {
                break;
            }

            if (goIn)
            {
                d.transform.localPosition *= 0.99f;
            }
            else
            {
                d.transform.localPosition *= 1.01f;
            }


            if (goIn && Vector3.Distance(d.transform.position, containerParent.transform.position) < distance / 2f)
            {
                goIn = false;
                yield return(new WaitForSeconds(((10 - rotateCircleDelay) + numberDotsOnCircle) / 2));
            }
            if (!goIn && Vector3.Distance(d.transform.position, containerParent.transform.position) > distance)
            {
                goIn = true;
                yield return(new WaitForSeconds(((10 - rotateCircleDelay) + numberDotsOnCircle) / 4));
            }

            yield return(new WaitForEndOfFrame());

            if (d == null)
            {
                break;
            }
        }
    }
Esempio n. 23
0
        private async Task <bool> DotSnapshot()
        {
            if (!ShinraEx.Settings.BardDotSnapshot ||
                !Core.Player.CurrentTarget.HasAura(VenomDebuff, true) ||
                !Core.Player.CurrentTarget.HasAura(WindDebuff, true) ||
                DotManager.Recent(Target))
            {
                return(false);
            }

            var crit   = DotManager.Difference(Target, true);
            var damage = crit + DotManager.Difference(Target);

            // Prioritise 30% crit buff
            if (crit >= 30 || crit >= 0 && damage >= 0 && (DotManager.CritExpiring || DotManager.DamageExpiring))
            {
                if (await MySpells.IronJaws.Cast())
                {
                    DotManager.Add(Target);
                    return(true);
                }
            }

            if (DotManager.Check(Target, true) >= 30)
            {
                return(false);
            }

            // Refresh during damage buffs
            if (damage >= 20 || damage >= 10 && Target.AuraExpiring(WindDebuff, true, 10000) || damage >= 0 && DotManager.BuffExpiring)
            {
                if (await MySpells.IronJaws.Cast())
                {
                    DotManager.Add(Target);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 24
0
    void CreateDotOnCircle()
    {
        Time.timeScale = 1;


        GameObject prefab = this.DotPrefab;
        Quaternion rot    = prefab.transform.rotation;

        Vector3   posTOP    = new Vector3(0, positionTouchBorderTOP, 0);
        Transform parentTOP = CircleBorderTOP;


        float numberTOP = numberDotsOnCircle * ratioNombreDotsOnCircleTop;


        for (int i = 0; i < (int)numberTOP; i++)
        {
            CircleTOP.rotation = Quaternion.Euler(new Vector3(0, 0, i * 360f / (int)numberTOP));

            DotManager dm = InstantiateDot(posTOP, rot, parentTOP);

            dm.ActivateLine(dm.transform.position, dm.transform.parent);
        }

        Vector3 posBOTTOM = new Vector3(0, positionTouchBorderBOTTOM, 0);

        float numberBOTTOM = numberDotsOnCircle * ratioNombreDotsOnCircleBottom;

        for (int i = 0; i < (int)numberBOTTOM; i++)
        {
            CircleBOTTOM.rotation = Quaternion.Euler(new Vector3(0, 0, i * 360f / (int)numberBOTTOM));

            DotManager dm = InstantiateDot(posBOTTOM, rot, CircleBorderBOTTOM);

            dm.ActivateLine(dm.transform.position, dm.transform.parent);
        }
    }
Esempio n. 25
0
        public bool Finish(int type)
        {
            if (!this.achives.ContainsKey(type.ToString()))
            {
                return(false);
            }
            LocalData localData = this.achives[type.ToString()];

            if (localData.status != -2)
            {
                return(false);
            }
            TAchive tAchive = Configs.Configs.TAchives[localData.key.ToString()];

            if (tAchive.Next == 0)
            {
                localData.status = -3;
            }
            else
            {
                TAchive tAchive2 = Configs.Configs.TAchives[tAchive.Next.ToString()];
                if (localData.value >= tAchive2.Value)
                {
                    localData.status = -2;
                    localData.key    = tAchive2.ID;
                }
                else
                {
                    localData.status = -1;
                    localData.key    = tAchive2.ID;
                }
            }
            this.achives[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            DotManager.GetInstance().CheckAchiev();
            return(true);
        }
Esempio n. 26
0
    void Update()
    {
        if (Input.GetButtonDown("Submit") && !isGameOver && canShoot)
        {
            if (DotsTop.Count > 0 || DotsBottom.Count > 0)
            {
                DotManager dTOP    = null;
                DotManager dBOTTOM = null;

                if (DotsTop.Count > 0)
                {
                    dTOP = DotsTop [0];
                }

                if (DotsBottom.Count > 0)
                {
                    dBOTTOM = DotsBottom [0];
                }

                StartCoroutine(ShootDot(dBOTTOM, dTOP));
//				OnclickedPlay ();
            }
        }
    }
Esempio n. 27
0
    void CreateListDots()
    {
        Dots = new List <DotManager>();

        for (int i = 0; i < numberDotsToCreate; i++)
        {
            var go = Instantiate(this.DotPrefab) as Transform;
            go.parent = transform;

            DotManager dm = go.GetComponent <DotManager> ();


            if (sizeDot == 0)
            {
                sizeDot = this.DotPrefab.GetComponent <DotManager> ().DotSprite.bounds.size.x * 1.1f;
            }


            Vector3 target = new Vector3(0, -GetPositionYTarget() + (-i - 1) * sizeDot, dm.transform.position.z);
            dm.transform.position = target;

            Dots.Add(dm);
        }
    }
Esempio n. 28
0
        public bool Finish(int type)
        {
            if (!this.tasks.ContainsKey(type.ToString()))
            {
                return(false);
            }
            LocalData localData = this.tasks[type.ToString()];

            if (localData.status != -2)
            {
                return(false);
            }
            TTask tTask = Configs.Configs.TTasks[localData.key.ToString()];

            if (localData.value < tTask.Value)
            {
                return(false);
            }
            localData.status            = -3;
            this.tasks[type.ToString()] = localData;
            this.SetLocalData(localData.type, localData.value, localData.key, localData.status);
            DotManager.GetInstance().CheckTask();
            return(true);
        }
Esempio n. 29
0
 // Use this for initialization
 void Start()
 {
     dotManager = GetComponent <DotManager>();
 }
Esempio n. 30
0
 private void Awake()
 {
     DotManager.m_instance = this;
 }
Esempio n. 31
0
    /// <summary>
    /// All the game level creation logic. We will create the current level.
    /// </summary>
    public void CreateGame(int level)
    {
        if (sequence != null)
        {
            sequence.Kill(false);
        }

        if (sequenceDOT == null)
        {
            ResetPosition();
            SequenceDOTLogic();
        }

        canvasManager.ButtonLogic();

        DOTween.Kill(CircleBorder);

        DOTween.Kill(CircleBorder);


        CancelInvoke();

        StopAllCoroutines();

        isGameOver = false;
        success    = false;

        Level = Util.GetLastLevelPlayed();

        Level l = levelManager.GetLevel(Level);

        numberDotsOnCircle = l.numberDotsOnCircle;

        SizeRayonRatio    = l.sizeRayonRation;
        rotateCircleDelay = l.rotateDelay;
        easeType          = l.rotateEaseType;
        loopType          = l.rotateLoopType;

        positionTouchBorder = height * SizeRayonRatio;

        canvasManager.ButtonLogic();

        PLAYER.localRotation = Quaternion.identity;

        Time.timeScale = 1;

        Application.targetFrameRate = 60;

        GC.Collect();

        PLAYER.localRotation = Quaternion.identity;


        PLAYER.localScale = new Vector3(-rotateDOTVector.z, 1, 1);

        PLAYER.localRotation = Quaternion.identity;

        spriteDotGameOverZoom.transform.DOScale(Vector3.zero, 0.5f);

        guyAnim.DoWalk();
        this.Level = level;

        Camera.main.orthographicSize   = cameraSize;
        Camera.main.transform.position = new Vector3(0, 0, -10);

        StopAllCoroutines();

        CircleCenterSprite.color = constant.SquareColor;

        poolSystem.DespawnAll();



        Camera.main.transform.position = new Vector3(0, 0, -10);

        rotateVector = new Vector3(0, 0, 1);

        if (Level % 2 == 0)
        {
            rotateVector = new Vector3(0, 0, -1);
        }

        CircleBorder.gameObject.SetActive(false);

        CircleBorder.localScale = Vector3.one;

        DOTween.Kill(PLAYER);

        PLAYER.localPosition = new Vector3(PLAYER.localPosition.x, floorPosition, PLAYER.localPosition.z);

        guyAnim.MakeItBlink();

        guyAnim.m_collider.enabled = false;

        CreateDotOnCircle();

        CircleBorder.localScale = Vector3.one * 0.001f;
        CircleBorder.gameObject.SetActive(true);

        int count = LIST_SQUARE.Count;

        guyAnim.MakeItBlink();

        guyAnim.m_collider.enabled = false;

        for (int i = 0; i < count; i++)
        {
            DotManager dm = LIST_SQUARE[i];

            dm.ActivateLine(dm.transform.position, dm.transform.parent);

            guyAnim.m_collider.enabled = false;
        }

        CircleBorder.DOScale(Vector3.one, 1)
        .SetDelay(0.3f)
        .SetEase(Ease.InBack)
        .OnComplete(() => {
            canvasManager.ButtonLogic();
            guyAnim.m_collider.enabled = false;

            Invoke("StopBlink", 1);
        });
    }