Exemplo n.º 1
0
 private void Awake()
 {
     _menuHandler = _menuHandlerObject.GetComponent <MenuHandler>();
     _renderer    = GetComponent <Renderer>();
     _renderer.material.mainTexture = textures[(int)_highlightedDifficulty];
     _playScript = _menuHandler._playScreen as PlayScript;
 }
Exemplo n.º 2
0
 public GameMessageScript(ObjectGuid guid, PlayScript scriptId, float speed = 1.0f)
     : base(GameMessageOpcode.PlayEffect, GameMessageGroup.SmartboxQueue)
 {
     Writer.WriteGuid(guid);
     Writer.Write((uint)scriptId);
     Writer.Write(speed);
 }
Exemplo n.º 3
0
 public GameMessageScript(Entity.ObjectGuid guid, PlayScript scriptId, float scale = 1f)
     : base(GameMessageOpcode.PlayEffect, GameMessageGroup.Group0A)
 {
     Writer.WriteGuid(guid);
     Writer.Write((uint)scriptId);
     Writer.Write(scale); // scale ?
 }
Exemplo n.º 4
0
        public PhysScript(PlayScript pscript, float?extent = null)

            : base(EmoteType.PhysScript)
        {
            PScript = pscript;
            Extent  = extent;
        }
Exemplo n.º 5
0
 public GameMessageScript(global::ACE.Entity.ObjectGuid guid, PlayScript scriptId, float scale = 1f)
     : base(GameMessageOpcode.PlayEffect, GameMessageGroup.SmartboxQueue)
 {
     Writer.WriteGuid(guid);
     Writer.Write((uint)scriptId);
     Writer.Write(scale); // scale ?
 }
Exemplo n.º 6
0
 // plays particle effect like spell casting or bleed etc..
 public void PlayParticleEffect(PlayScript effectId, ObjectGuid targetId)
 {
     if (CurrentLandblock != null)
     {
         var effectEvent = new GameMessageScript(targetId, effectId);
         CurrentLandblock.EnqueueBroadcast(Location, Landblock.MaxObjectRange, effectEvent);
     }
 }
Exemplo n.º 7
0
 public void ApplyVisualEffects(PlayScript effect)
 {
     // new ActionChain(this, () => PlayParticleEffect(effect, Guid)).EnqueueChain();
     if (CurrentLandblock != null)
     {
         PlayParticleEffect(effect, Guid);
     }
 }
Exemplo n.º 8
0
 void OnCollisionEnter(Collision coll)
 {
     print(coll.collider.tag);
     if (coll.collider.tag == "Bonus")
     {
         print("Yes");
         PlayScript.positionPointGenerating(gameObject);
     }
 }
Exemplo n.º 9
0
 public static BroadcastEventArgs CreateEffectAction(WorldObject sender, PlayScript effect)
 {
     return(new BroadcastEventArgs()
     {
         ActionType = BroadcastAction.PlayParticleEffect,
         Sender = sender,
         Effect = effect
     });
 }
Exemplo n.º 10
0
    public static PlayScript instance;   // 오브젝트 유지

    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(this);
        PlayScript.instance = this;
    }
Exemplo n.º 11
0
        public List <uint> GetEmitterInfoIDs(uint pEffectTableID, PlayScript playScript, float mod = 0.0f)
        {
            var pEffectTable = DatManager.PortalDat.ReadFromDat <ACE.DatLoader.FileTypes.PhysicsScriptTable>(pEffectTableID);
            var scripts      = pEffectTable.ScriptTable[(uint)playScript].Scripts;

            var modIdx = GetModIdx(scripts.Select(s => s.Mod).OrderByDescending(m => m).ToList(), mod);

            var scriptModDataEntry = scripts.Where(s => s.Mod == modIdx).FirstOrDefault();

            return(GetEmitterInfoIDs(scriptModDataEntry.ScriptId));
        }
Exemplo n.º 12
0
    // Update is called once per frame
    void FixedUpdate()
    {
        distance += speed * Time.deltaTime;

        if (Application.platform == RuntimePlatform.Android)
        {
            UpdateWithTouchInteraction();
        }
        else
        {
            UpdateWithMouseInteraction();
        }
        textScore.text  = "Score : " + score;
        textScore.text += "\nDistance : " + String.Format("{0:.00}", distance);
        time.value     -= Time.deltaTime;

        if (time.value <= 0)
        {
            PlayScript.EndGame(score, distance);
        }
    }
Exemplo n.º 13
0
        public static void HandlePlayEffect(Session session, params string[] parameters)
        {
            try
            {
                PlayScript effect      = PlayScript.Invalid;
                string     message     = "";
                float      scale       = 1f;
                var        effectEvent = new GameMessageScript(session.Player.Guid, PlayScript.Invalid);

                if (parameters.Length > 1)
                {
                    if (parameters[1] != "")
                    {
                        scale = float.Parse(parameters[1]);
                    }
                }

                message = $"Unable to find a effect called {parameters[0]} to play.";

                if (Enum.TryParse(parameters[0], true, out effect))
                {
                    if (Enum.IsDefined(typeof(PlayScript), effect))
                    {
                        message = $"Playing effect {Enum.GetName(typeof(PlayScript), effect)}";
                        session.Player.HandleActionApplyVisualEffect(effect);
                    }
                }

                var sysChatMessage = new GameMessageSystemChat(message, ChatMessageType.Broadcast);
                session.Network.EnqueueSend(sysChatMessage);
            }
            catch (Exception)
            {
                // Do Nothing
            }
        }
Exemplo n.º 14
0
 void Awake()
 {
     instance = this;
 }
Exemplo n.º 15
0
        public void HandleParticleEffectEvent(WorldObject sender, PlayScript effect)
        {
            BroadcastEventArgs args = BroadcastEventArgs.CreateEffectAction(sender, effect);

            Broadcast(args, true, Quadrant.All);
        }
Exemplo n.º 16
0
 public uint GetScript(PlayScript type, float mod)
 {
     return(0);
 }
Exemplo n.º 17
0
        public void InitEmitter(uint pEffectTableID, PlayScript playScript, float mod = 0.0f)
        {
            var createParticleHooks = GetCreateParticleHooks(pEffectTableID, playScript, mod);

            InitEmitter(createParticleHooks, mod);
        }
Exemplo n.º 18
0
 public int GetScript(PlayScript type, float mod)
 {
     return(-1);
 }
Exemplo n.º 19
0
        public void InitEmitter(uint pEffectTableID, PlayScript playScript, float mod = 0.0f)
        {
            var emitterInfoIDs = GetEmitterInfoIDs(pEffectTableID, playScript, mod);

            InitEmitter(emitterInfoIDs, mod);
        }
Exemplo n.º 20
0
		private void WriteDynamicClass(PlayScript.IDynamicClass dc)
        {
            foreach (string key in dc.__GetDynamicNames()) {
                TypelessWrite(key);
                Write(dc.__GetDynamicValue(key));
            }

            TypelessWrite("");
        }
Exemplo n.º 21
0
        private static int Menu(string header, int menuWidth, PlayScript script, params string[] options)
        {
            Console.Clear();
            int  chosen         = 0;
            bool scriptisPlayed = false;

            while (true)
            {
                Console.SetCursorPosition(0, 0);
                DrawHeader(header, menuWidth);
                ConsoleShef.ChangeMood("regular");

                foreach (var option in options)
                {
                    if (option == options[chosen])
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.Write(TableBuilder.AlignCentre(option, menuWidth));
                        Console.ForegroundColor = ConsoleColor.White;
                    }
                    else
                    {
                        Console.Write(TableBuilder.AlignCentre(option, menuWidth));
                    }
                    Console.SetCursorPosition(0, Console.CursorTop + 1);
                }
                if (!scriptisPlayed)
                {
                    script();
                    scriptisPlayed = true;
                }

                switch (Console.ReadKey(true).Key)
                {
                case ConsoleKey.Enter:
                    Console.Clear();
                    return(chosen);

                case ConsoleKey.UpArrow:
                    if (chosen == 0)
                    {
                        chosen = options.Length - 1;
                    }
                    else
                    {
                        chosen--;
                    }
                    break;

                case ConsoleKey.DownArrow:
                    if (chosen == options.Length - 1)
                    {
                        chosen = 0;
                    }
                    else
                    {
                        chosen++;
                    }
                    break;

                case ConsoleKey.Escape: return(-1);
                }
            }
        }
Exemplo n.º 22
0
 void Start()
 {
     audioSrc   = GetComponent <AudioSource>();
     animator   = GetComponent <Animator>();
     playScript = GetComponent <PlayScript>();
 }