Example #1
0
        public TargetView(Canvas canvas)
        {
            this.canvas = canvas;
            var image = new GameObject().AddComponent <Image>();

            image.sprite = Resources.Load <Sprite>(@"Views\TargetLock");
            pointerPool  = new SpecialObjectPool <GameObject <Image> >(new GameObject <Image>(image, canvas.transform));

            outPointerPool = new SpecialObjectPool <GameObject <TargetPointerBehaviour> >(new GameObject <TargetPointerBehaviour>(Resources.Load <TargetPointerBehaviour>(@"Views\TargetPointer"), canvas.transform));
        }
Example #2
0
    void Awake()
    {
        enabled = false;

        friendMaterial       = Instantiate(shipView.sharedMaterial);
        friendMaterial.color = Color.green;

        enemyMaterial       = Instantiate(shipView.sharedMaterial);
        enemyMaterial.color = Color.red;

        beacons = new SpecialObjectPool <GameObject <Renderer> >(new GameObject <Renderer>(shipView, transform));
    }