Example #1
0
        public async Task <RestResponse> Say(ulong channelID)
        {
            var parts = CurrentBody.Split('␞');

            if (parts.Length != 3)
            {
                return(new RestResponse(HttpStatusCode.BadRequest, $"Expected 3 lines in body, got {parts.Length}"));
            }

            int c = CurrentBody.Length;

            var content  = parts[0];
            var fileName = parts[1];
            var fileB64  = parts[2];

            var channel = await Android.Client.Rest.GetChannelAsync(channelID);

            if (channel is ITextChannel tc)
            {
                if (!string.IsNullOrWhiteSpace(fileB64))
                {
                    var bytes = Convert.FromBase64String(fileB64);
                    using MemoryStream stream = new MemoryStream(bytes);
                    await tc.SendFileAsync(stream, fileName, content);
                }
                else
                {
                    await tc.SendMessageAsync(content);
                }
            }

            return(RestResponse.Ok);
        }
Example #2
0
    protected override void OnCollision(Collision collision)
    {
        var entity = collision.transform.GetComponent <BaseEntity>();

        if (entity != null && entity.IsPlayer)
        {
            PlayerManager.Instance.InstanceP.HitByEnnemy(this);
            CurrentBody.TransformIntoProjecticle(collision.transform.position);
            CurrentBody.transform.SetParent(transform.parent);
            SelfDestroy(false);
        }
    }
Example #3
0
 public void SwitchBody(BaseEntity NextBody, PlayerConfig Config, int IndexStruct)
 {
     _data.Init(Config, IndexStruct);
     CurrentBody.SelfDestroy();
     CurrentBody = NextBody;
     CurrentBody.Init(transform, true);
     ResetHP();
     _modeSwitchOn      = false;
     CurrentPowerCharge = 0f;
     //Time.timeScale = 1.0f;
     StartCoroutine(BackSlerpToRealTimeScale());
 }