コード例 #1
0
        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;
        }
コード例 #2
0
        private void OnCollisionEnter(Collision collision)
        {
            PlayAreaPlane playAreaPlane = collision.gameObject.GetComponent <PlayAreaPlane>();

            if (playAreaPlane)
            {
                switch (playAreaPlane.PlayAreaWallType)
                {
                case EPlayAreaPlaneType.FLOOR:
                    AudioManager.Instance.SpawnSoundObject(transform.position, floorCollisionSound);
                    break;

                case EPlayAreaPlaneType.WALL:
                    AudioManager.Instance.SpawnSoundObject(transform.position, wallCollisionSound);
                    break;
                }
            }
        }
コード例 #3
0
        private void CreatePlaneMesh(Vector3 origin, Vector3 forward, Vector3 corner, Vector3 right, EPlayAreaPlaneType planeType)
        {
            if (IS_NOT_NULL(playAreaPlanePrefab))
            {
                PlayAreaPlane plane = Instantiate(playAreaPlanePrefab, Vector3.zero, Quaternion.identity);
                if (plane)
                {
                    plane.SetVertices(new Vector3[]
                    {
                        origin,
                        forward,
                        corner,
                        right,
                    });

                    plane.transform.position         = Vector3.zero;
                    plane.transform.transform.parent = rectanglePlayArea.transform;

                    plane.PlayAreaWallType = planeType;
                }
            }
        }