void OnDestroy() { PuzzleTouch.onFingerDrag -= OnCameraMove; PuzzleTouch.onFingerPinched -= OnCameraZoom; PuzzleTouch.onObjMove -= OnObjMove; Instance = null; }
void InternalInit(PolyGraph graph, bool[] finished) { Clear(); this.graph = graph; graph.transform.localPosition = new Vector3(0f, 0f, Config.Instance.zorder.debrisStart); var renderer = graph.GetComponentInChildren <MeshRenderer>(); if (null != renderer) { InitMaterial(renderer.sharedMaterial); } for (int i = 0; i < graph.transform.childCount; ++i) { var child = graph.transform.GetChild(i); child.gameObject.layer = Layers.Snapshot; renderer = child.GetComponent <MeshRenderer>(); if (null != renderer) { if (null == finished || i >= finished.Length || !finished[i]) { renderer.sharedMaterial = greyscaleMat; } else { renderer.sharedMaterial = originMat; } } } PuzzleCamera.SetupCamera(ssCamera, graph.size, Config.Instance.camera.sizeExtendScale); InitBackground(null == finished); }
private IEnumerator WaitForCamera() { PuzzleCamera puzzleCamera = mainCam.GetComponent<PuzzleCamera>(); while (puzzleCamera.cameraMoving) { yield return null; } nextArrow.SetActive(true); }
private void Start() { GameObject stageGo = GameObject.FindGameObjectWithTag("Stage"); raiseCubes = stageGo.GetComponent <RaiseCubes>(); floorBlocks = stageGo.GetComponent <FloorBlocks>(); playerController = GetComponent <PlayerController>(); endPuzzleCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PuzzleCamera>(); }
void Awake() { Instance = this; PuzzleTouch.onFingerDrag += OnCameraMove; PuzzleTouch.onFingerPinched += OnCameraZoom; }
private void Start() { puzzleCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PuzzleCamera>(); }