protected void Start()
 {
     base.Start();
     targeter = GetComponent <Targeter>();
     targeter.onAcquiredTarget.AddListener(AcquiredTarget);
     targeter.onLostTarget.AddListener(LostTarget);
 }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            Targeter targeter = GetComponent <Targeter>();

            targeter.onAcquiredTarget.AddListener(FoundTarget);
            hudOB = WorldUI.instance.CreateTargetHUD(transform);
            hudOB.gameObject.SetActive(false);
        }
Esempio n. 3
0
 public void Init(Transform target, bool IndicateOffScreen, Vector3 offset, Vector2 size, Targeter targeter)
 {
     Init(target, IndicateOffScreen, offset);
     this.targeter = targeter;
     GetComponent <Image>().rectTransform.sizeDelta = size;
     targeter.onAcquiredTarget.AddListener(FoundTarget);
     targeter.onLostTarget.AddListener(LostTarget);
 }
Esempio n. 4
0
        protected void Start()
        {
            waypoints = WayPointsParent.GetComponentsInChildren <Transform>();
            //    weapon = GetComponentsInChildren<Weapon>();
            ai = GetComponent <WayPointVehicleAI>();
            Targeter radar = GetComponent <Targeter>();

            radar.onAcquiredTarget.AddListener(AcquiredTarget);
            radar.onLostTarget.AddListener(LoseTarget);
            ai.DScurve = patrollingCurve;
            ai.SetDestination(waypoints[0].position);
        }
        void Start()
        {
            targeter = GetComponent <Targeter>();
            CapsuleCollider capsule = GetComponent <CapsuleCollider>();

            areaTransform = Instantiate(Resources.Load <GameObject>("TargetArea")).transform;
            line          = areaTransform.GetComponentInChildren <LineRenderer>();
            offset.x      = capsule.center.x;
            offset.z      = capsule.center.z;
            // areaTransform.localScale = Vector3.one * capsule.radius * 2;
            line.positionCount = circleDetail * (int)capsule.radius;
            for (int i = 0; i < line.positionCount; i++)
            {
                var rad = Mathf.Deg2Rad * (i * 360f / line.positionCount);
                line.SetPosition(i, new Vector3(Mathf.Sin(rad) * capsule.radius, 0, Mathf.Cos(rad) * capsule.radius));
            }
        }