Example #1
0
    void PlayFXFromPool(FXPool pool, Vector3 position)
    {
        FX playedFX = pool.Depool();

        playedFX.transform.position = position;
        playedFX.Play();
    }
Example #2
0
    void PlayFXFromPool(FXPool pool, Vector3 _position, Transform _parent)
    {
        FX playedFX = pool.Depool();

        playedFX.transform.position = _position;
        playedFX.Play();
        playedFX.transform.parent = _parent;
    }
Example #3
0
    public FX PlayFX(FX_Type fx_Type, Vector3 from)
    {
        FX fx = GameObjectPoolManager.Instance.FXDict[fx_Type].AllocateGameObject <FX>(transform);

        fx.transform.position = from;
        fx.Play();
        return(fx);
    }
Example #4
0
    public void PlayFlashEffect(Transform dummyPos)
    {
        FX fx = FXManager.Instance.PlayFX(FlashFXName, dummyPos.position);

        if (fx)
        {
            fx.transform.parent     = dummyPos;
            fx.transform.localScale = Vector3.one * Scale;
            fx.transform.forward    = dummyPos.forward;
            fx.Play();
        }
    }
Example #5
0
 //Fonction jouant toutes les FX indiquant une panne sur le système,à échelonner plus tard)
 private void Play_Stop_All_Pannel_FX(bool startStop)
 {
     foreach (ParticleSystem FX in FX_pannel)
     {
         if (startStop)
         {
             FX.Play();
         }
         else
         {
             FX.Stop();
         }
     }
 }
Example #6
0
 private void ThrustCheck()
 {
     if (Input.GetKey(ThrustKey))
     {
         //print("Thrusting");
         //rb.AddRelativeForce(force); //Vector3.Up; set mass to 0.1; set drag to .2
         rb.AddRelativeForce(thrustForce * Vector3.up * Time.deltaTime);
         ThrustFX.Play();
     }
     else
     {
         ThrustFX.Stop();
     }
 }
Example #7
0
    public FX PlayFX(string fxName, Vector3 position, float scale = 1.0f)
    {
        ushort fxTypeIndex = ConfigManager.GetFXTypeIndex(fxName);

        if (GameObjectPoolManager.Instance.FXDict.ContainsKey(fxTypeIndex))
        {
            FX fx = GameObjectPoolManager.Instance.FXDict[fxTypeIndex].AllocateGameObject <FX>(Root);
            fx.transform.position   = position;
            fx.transform.localScale = Vector3.one * scale;
            fx.transform.rotation   = Quaternion.identity;
            fx.Play();
            return(fx);
        }

        return(null);
    }
Example #8
0
    void PlayFXFromPool(FXPool pool, Transform _transform, bool textMessage, Color color, string text, float height)
    {
        FX playedFX = pool.Depool();

        playedFX.transform.parent        = _transform;
        playedFX.transform.localPosition = Vector3.zero;

        if (textMessage)
        {
            TextMessage message = (TextMessage)playedFX;
            message.SetTextAndPlay(text, color, height);
        }
        else
        {
            playedFX.Play();
        }
    }
Example #9
0
        public static Action <object> ParseMessageToAction(Message message)
        {
            if (message.Type == MsgType.Reply)
            {
                throw new InvalidOperationException("Server received MsgType.Reply... those are meant to only flow the other way.");
            }
            if (message.Type == MsgType.Notify)
            {
                return(null);                                // Notify messages ONLY raise the OnReceiveMessage event and nothing else.
            }
            if (message.Type == MsgType.LaunchActivity)
            {
                var substrings           = message.Content.Split(onNEXT);
                var type                 = Type.GetType(substrings[0]);
                var tdata                = Type.GetType(substrings[1]);
                var serializedPassedInfo = substrings[2]; // Currently nothing is done with this, since it'll be a right pain in the arse to do.

                return((o) =>
                {
                    // Todo - embed the PassedInfo into somewhere (Res? try again for Bundle syntax?) before this.
                    Application.Context.StartActivity(type);
                });
            }
            if (message.Type == MsgType.PushSFX)
            {
                IEffect FX;
                if (!Res.SFX.Effects.TryGetValue($"RequestedFX{NEXT}{message.Content}", out FX))
                {
                    if (!int.TryParse(message.Content, out int ResourceID))
                    {
                        ResourceID = typeof(Resource.Id).GetStaticProperty <int>(message.Content);
                    }
                    FX = Res.SFX.Register($"RequestedFX{NEXT}{message.Content}", ResourceID);
                }
                if (FX == null)
                {
                    return(null);
                }

                return((o) =>
                {
                    FX.Activate();
                    FX.Play();
                });
            }
            if (message.Type == MsgType.PushSpeech)
            {
                return((o) =>
                {
                    Speech.Say(message.Content);
                });
            }
            if (message.Type == MsgType.PushEffect)
            {
                var substrings   = message.Content.Split(onNEXT, 2);
                var effectName   = substrings[0];
                var effectParams = substrings[1];
                //if (!MasterSpellLibrary.CastingResults.ContainsKey(effectName))
                //{
                //    Log.Warn(_tag, $"Unable to locate game effect '{effectName}'.");
                //    return null;
                //}
                if (!GameEffect.Definition.ContainsKey(effectName))
                {
                    Log.Warn(_tag, $"Unable to locate effect '{effectName}'.");
                    return(null);
                }

                //var doFunc = MasterSpellLibrary.CastingResults[effectName];
                return((o) =>
                {
                    GameEffect
                    .Definition[effectName]?
                    .OnReceiving(TemporaryAddressBook_SingleEntry ?? new CommsContact(), effectParams);
                });
            }
            if (message.Type == MsgType.PushEffect2)
            {
                var effectInstance = GameEffectInstance.FromStringForm(message.Content);

                //var doFunc = MasterSpellLibrary.CastingResults[effectName];
                return((o) =>
                {
                    effectInstance?
                    .SourceEffect?
                    .OnReceiving2(effectInstance);
                });
            }
            if (message.Type == MsgType.Query)
            {
                return((o) =>
                {
                    var target = AddressBook.Resolve(message.From);
                    target.SendMessage(DataLibrarian.FetchRequestedData(message, o));
                });
            }
            if (message.Type == MsgType.SetScenarioVariable)
            {
                var substrings = message.Content.Split(onNEXT);
                Encounters.Scenario.Current.SetVariable(substrings[0],
                                                        (Encounters.Scenario.State)Enum.Parse(typeof(Encounters.Scenario.State), substrings[1]), false); // False meaning don't rebroadcast it.
            }
            throw new NotImplementedException();
        }