protected override void Awake() { base.Awake(); playAreaPlanePrefab = Resources.Load <PlayAreaPlane>(BConsts.PATH_AR_PlayAreaPlane); dropZonePrefab = Resources.Load <DropZonePlane>(BConsts.PATH_DZ_DropZonePlane); playAreaSeparationPrefab = Resources.Load <PlayAreaSeparation>(BConsts.PATH_DZ_PlayAreaSeparation); BEventsCollection.AR_PlayAreaStateUpdated += On_AR_PlayAreaStateUpdated; }
//private void Create private void CreatePlayAreaSeparation(Vector3 middle1, Vector3 middle2, Vector3 forwardVector, Vector3 upVector) { if (IS_NOT_NULL(playAreaSeparationPrefab)) { PlayAreaSeparation plane = Instantiate(playAreaSeparationPrefab, Vector3.zero, Quaternion.identity); if (plane) { plane.SetVertices(new Vector3[] { middle1 - forwardVector * playAreaSeperatorThickness + upVector * 0.04f, middle1 + forwardVector * playAreaSeperatorThickness + upVector * 0.04f, middle2 + forwardVector * playAreaSeperatorThickness + upVector * 0.04f, middle2 - forwardVector * playAreaSeperatorThickness + upVector * 0.04f, }); plane.transform.position = Vector3.zero; plane.transform.transform.parent = rectanglePlayArea.transform; plane.PlayAreaWallType = EPlayAreaPlaneType.FLOOR; } } }