コード例 #1
0
ファイル: BoundaryCircle.cs プロジェクト: Ownfos/Shrewd
 void Start()
 {
     // Note that setting the size of polygon to zero will result in zero vectors.
     // Since the polygon class's resizing logic uses vertices' normalized vectors,
     // setting it to zero will permanetly disable future resizing.
     polygon = GetComponent <OutlinedPolygon>();
     polygon.UpdateInnerSize(0.0001f);
     polygon.UpdateOuterSize(0.0001f);
 }
コード例 #2
0
ファイル: Effect1.cs プロジェクト: Ownfos/Shrewd
    void Update()
    {
        life += Time.deltaTime;

        var outerSize = Math.Min(maxSize, size * (float)Math.Log10(life * speed + 1.0));

        polygon.UpdateOuterSize(outerSize);
        polygon.UpdateInnerSize(outerSize * (1.0f - (float)Math.Pow(0.8, life * speed)));

        // Start fading out when the amount of life left is less then vanishLimit
        // Before this point, the polygon will not be transparent
        if (maxLife - life <= vanishLimit)
        {
            polygon.UpdateAlpha((maxLife - life) / vanishLimit);

            if (life >= maxLife)
            {
                Destroy(gameObject);
            }
        }
    }
コード例 #3
0
ファイル: BoundaryCircle.cs プロジェクト: Ownfos/Shrewd
 void Update()
 {
     currentRadius += (targetRadius - currentRadius) * lerpSpeed;
     polygon.UpdateOuterSize(currentRadius + borderThickness);
     polygon.UpdateInnerSize(currentRadius);
 }
コード例 #4
0
 private void Start()
 {
     polygon = GetComponent <OutlinedPolygon>();
     polygon.UpdateInnerSize(size);
     polygon.UpdateOuterSize(size + borderThickness);
 }