Example #1
0
    public IEnumerator Behave009(float x, float arrivalY, float sX, float t, GameObject originalShot)
    {
        transform.position = new Vector3(x, StgFrame.topS + BodyRadius);
        SetDestAtTime(this.X, arrivalY, t);

        {
            var curT = 0f;
            while (Speed != 0)
            {
                yield return(null);

                curT  += TimeManager.DeltaTime;
                this.X = x + sX / 2 + sX / 2 * Mathfd.Cos(-180f + 180f * curT / t);
            }
        }

        for (var i = 0; i < 3; i++)
        {
            Fire(originalShot, StgFrame.height / 1.8f, -90f);
            yield return(Yielder.WaitForFixedSeconds(0.25f));
        }

        Acceleration = StgFrame.height / 4;
        SpeedLimit   = StgFrame.height / 1;
    }
Example #2
0
    public StgAct FireR(GameObject original, float r, float speed, float angle)
    {
        StgAct clone = StgAct.ApparentInstantiate(original);

        clone.transform.position = transform.position + (Vector3)(r * new Vector2(Mathfd.Cos(angle), Mathfd.Sin(angle)));
        clone.Speed = speed;
        clone.Angle = angle;

        return(clone);
    }