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>();
 }
예제 #2
0
 // 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;
 }
예제 #4
0
 void Awake()
 {
     Instance = this;
 }