August 2018
Beginner
334 pages
10h 19m
English
We will implement two classes—FormationPattern and FormationManager:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class FormationPattern: MonoBehaviour
{
public int numOfSlots;
public GameObject leader;
}
void Start()
{
if (leader == null)
leader = transform.gameObject;
}
public virtual Vector3 GetSlotLocation(int slotIndex)
{
return Vector3.zero;
}
public bool SupportsSlots(int slotCount)
{
return slotCount <= numOfSlots;
}
Read now
Unlock full access