public void SetUp() { canvas = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/canvas")); MainCam = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/Main Camera")); X = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/X")); O = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/O")); Scroller = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/Scroller")); scroolFloor = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/SideScroller/scrollFloor")); XButton = canvas.transform.GetChild(0).gameObject.GetComponent <SideScrollerButton>(); OButton = canvas.transform.GetChild(1).gameObject.GetComponent <SideScrollerButton>(); SSM = MainCam.GetComponent <SideScrollerManager>(); SSM.X = X; SSM.O = O; SSS = Scroller.GetComponent <SideScrollerScroller>(); SSPX = X.GetComponent <SideScrollerPlayer>(); SSPO = O.GetComponent <SideScrollerPlayer>(); }
// Start is called before the first frame update void Start() { Manager = SideScrollerManager.Instance; }
// Start is called before the first frame update void Awake() { rb = GetComponent <Rigidbody2D>(); Manager = SideScrollerManager.Instance; }
void Awake() { Instance = this; }