示例#1
0
        private void Reset()
        {
            line = GetComponent <LineRenderer>();

            if (line == null)
            {
                line = gameObject.AddComponent <LineRenderer>();
            }

            Thrower = GetComponent <IThrower>();

            SetLineRenderer();
        }
示例#2
0
        private void Start()
        {
            SetLineRenderer();

            if (HitPoint && HitPoint.IsPrefab())
            {
                HitPoint = Instantiate(HitPoint, transform);
            }

            if (line.sharedMaterial == null)
            {
                line.material = new Material(Shader.Find("Sprites/Default"));
            }

            Thrower = GetComponent <IThrower>();

            if (Thrower != null)
            {
                Thrower.Predict += DisplayTraj;
            }
        }