public void StartVals() { //permutationsUtilitiesCore = new Core(); permutationsUtilitiesCore = gameObject.AddComponent <Core>(); playerScript = PlayerScript.player; loader = DataLoader.loader; solarSystem = new SolarSystem(); piecesController = PiecesController.piecesController; mainCameraTransform = Camera.main.transform; rangeToAttackEnemy = 3; rangeToEnableEnemy = 3; rangeForPlayerToStop = 1; //currentPlayerState = PlayerState.menuSelection; // chestInTown = transform.GetChild (0).GetChild(1).gameObject; //chestInTownScript = chestInTown.GetComponent<ChestInTownScript> (); player = PlayerScript.player.gameObject; playerTransform = player.transform; listOfProjectiles = new List <GameObject> (); planet = solarSystem.planetList [0]; layerPlanetMask = ~layerPlanetMask; layerMaskSphereCollider = ~layerMaskSphereCollider; // SwipeManager.swipeManger.SetMinSwipeLength(.1f); }
void Awake() { if (piecesController == null) //if there is not a control already in this scene { piecesController = this; // the control is this object } }
void OnEnable() { piecesController = PiecesController.piecesController; myTransform = transform; //cache my transform matchToBottom = myTransform.GetChild(0); // get matchBottom matchToCenter = myTransform.parent; // get matchCenter myShadow = myTransform.parent.parent.GetChild(0);; if (myTransform.parent.rotation != myShadow.rotation) { myTransform.parent.rotation = myShadow.rotation; } //puzzleScript = puzzle.GetComponent<PuzzleScript> ();// define puzzle script //StopAllCoroutines(); ParentToChild(myTransform, matchToCenter); //make the center my parent spinPiece = StartCoroutine(SpinPiece()); // start spinning }
/// <summary> /// Called as soon as the instance is enabled. Sets the singleton and offset data arrays. /// </summary> private void Awake() { instance = this; if (!GameEngine.instance.replay.mode) { bag = new List <int>(); for (int i = 0; i < 16; i++) { // bag.Add(new List<int> { 0, 1, 2, 3, 4, 5, 6 }); List <int> bagshuff = new List <int>() { 0, 1, 2, 3, 4, 5, 6 }; Shuffle(bagshuff); Debug.Log(bagshuff); for (int j = 0; j < 7; j++) { bag.Add(bagshuff[j]); } } } else { bag = GameEngine.instance.replay.bag; } JLSTZ_OFFSET_DATA = new Vector2Int[5, 4]; JLSTZ_OFFSET_DATA[0, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 1] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 3] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 1] = new Vector2Int(1, 0); JLSTZ_OFFSET_DATA[1, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 3] = new Vector2Int(-1, 0); JLSTZ_OFFSET_DATA[2, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[2, 1] = new Vector2Int(1, -1); JLSTZ_OFFSET_DATA[2, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[2, 3] = new Vector2Int(-1, -1); JLSTZ_OFFSET_DATA[3, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[3, 1] = new Vector2Int(0, 2); JLSTZ_OFFSET_DATA[3, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[3, 3] = new Vector2Int(0, 2); JLSTZ_OFFSET_DATA[4, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 1] = new Vector2Int(1, 2); JLSTZ_OFFSET_DATA[4, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 3] = new Vector2Int(-1, 2); I_OFFSET_DATA = new Vector2Int[5, 4]; I_OFFSET_DATA[0, 0] = Vector2Int.zero; I_OFFSET_DATA[0, 1] = new Vector2Int(-1, 0); I_OFFSET_DATA[0, 2] = new Vector2Int(-1, 1); I_OFFSET_DATA[0, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[1, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[1, 1] = Vector2Int.zero; I_OFFSET_DATA[1, 2] = new Vector2Int(1, 1); I_OFFSET_DATA[1, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[2, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[2, 1] = Vector2Int.zero; I_OFFSET_DATA[2, 2] = new Vector2Int(-2, 1); I_OFFSET_DATA[2, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[3, 1] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 2] = new Vector2Int(1, 0); I_OFFSET_DATA[3, 3] = new Vector2Int(0, -1); I_OFFSET_DATA[4, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[4, 1] = new Vector2Int(0, -2); I_OFFSET_DATA[4, 2] = new Vector2Int(-2, 0); I_OFFSET_DATA[4, 3] = new Vector2Int(0, 2); O_OFFSET_DATA = new Vector2Int[1, 4]; O_OFFSET_DATA[0, 0] = Vector2Int.zero; O_OFFSET_DATA[0, 1] = Vector2Int.down; O_OFFSET_DATA[0, 2] = new Vector2Int(-1, -1); O_OFFSET_DATA[0, 3] = Vector2Int.left; if (GameEngine.instance.RS == RotationSystems.ARS) { JLSTZ_OFFSET_DATA = new Vector2Int[5, 4]; JLSTZ_OFFSET_DATA[0, 0] = Vector2Int.up; JLSTZ_OFFSET_DATA[0, 1] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 3] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 0] = new Vector2Int(-1, 1); JLSTZ_OFFSET_DATA[1, 1] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[1, 2] = new Vector2Int(-1, 0); JLSTZ_OFFSET_DATA[1, 3] = new Vector2Int(-2, 0); JLSTZ_OFFSET_DATA[2, 0] = new Vector2Int(-1, 1); JLSTZ_OFFSET_DATA[2, 1] = new Vector2Int(-2, 0); JLSTZ_OFFSET_DATA[2, 2] = new Vector2Int(-1, 0); JLSTZ_OFFSET_DATA[2, 3] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[3, 0] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[3, 1] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[3, 2] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[3, 3] = new Vector2Int(0, 0); JLSTZ_OFFSET_DATA[4, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 1] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 3] = Vector2Int.zero; I_OFFSET_DATA = new Vector2Int[5, 4]; I_OFFSET_DATA[0, 0] = Vector2Int.zero; I_OFFSET_DATA[0, 1] = new Vector2Int(-1, 0); I_OFFSET_DATA[0, 2] = new Vector2Int(-1, 0); I_OFFSET_DATA[0, 3] = new Vector2Int(-1, 1); I_OFFSET_DATA[1, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[1, 1] = Vector2Int.zero; I_OFFSET_DATA[1, 2] = new Vector2Int(1, 1); I_OFFSET_DATA[1, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[2, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[2, 1] = Vector2Int.zero; I_OFFSET_DATA[2, 2] = new Vector2Int(-2, 1); I_OFFSET_DATA[2, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[3, 1] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 2] = new Vector2Int(1, 0); I_OFFSET_DATA[3, 3] = new Vector2Int(0, -1); I_OFFSET_DATA[4, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[4, 1] = new Vector2Int(0, -2); I_OFFSET_DATA[4, 2] = new Vector2Int(-2, 0); I_OFFSET_DATA[4, 3] = new Vector2Int(0, 2); O_OFFSET_DATA = new Vector2Int[1, 4]; O_OFFSET_DATA[0, 0] = Vector2Int.zero; O_OFFSET_DATA[0, 1] = Vector2Int.down; O_OFFSET_DATA[0, 2] = new Vector2Int(-1, -1); O_OFFSET_DATA[0, 3] = Vector2Int.left; } }
/// <summary> /// Called as soon as the instance is enabled. Sets the singleton and offset data arrays. /// </summary> private void Awake() { instance = this; JLSTZ_OFFSET_DATA = new Vector2Int[5, 4]; JLSTZ_OFFSET_DATA[0, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 1] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[0, 3] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 1] = new Vector2Int(1, 0); JLSTZ_OFFSET_DATA[1, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[1, 3] = new Vector2Int(-1, 0); JLSTZ_OFFSET_DATA[2, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[2, 1] = new Vector2Int(1, -1); JLSTZ_OFFSET_DATA[2, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[2, 3] = new Vector2Int(-1, -1); JLSTZ_OFFSET_DATA[3, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[3, 1] = new Vector2Int(0, 2); JLSTZ_OFFSET_DATA[3, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[3, 3] = new Vector2Int(0, 2); JLSTZ_OFFSET_DATA[4, 0] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 1] = new Vector2Int(1, 2); JLSTZ_OFFSET_DATA[4, 2] = Vector2Int.zero; JLSTZ_OFFSET_DATA[4, 3] = new Vector2Int(-1, 2); I_OFFSET_DATA = new Vector2Int[5, 4]; I_OFFSET_DATA[0, 0] = Vector2Int.zero; I_OFFSET_DATA[0, 1] = new Vector2Int(-1, 0); I_OFFSET_DATA[0, 2] = new Vector2Int(-1, 1); I_OFFSET_DATA[0, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[1, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[1, 1] = Vector2Int.zero; I_OFFSET_DATA[1, 2] = new Vector2Int(1, 1); I_OFFSET_DATA[1, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[2, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[2, 1] = Vector2Int.zero; I_OFFSET_DATA[2, 2] = new Vector2Int(-2, 1); I_OFFSET_DATA[2, 3] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 0] = new Vector2Int(-1, 0); I_OFFSET_DATA[3, 1] = new Vector2Int(0, 1); I_OFFSET_DATA[3, 2] = new Vector2Int(1, 0); I_OFFSET_DATA[3, 3] = new Vector2Int(0, -1); I_OFFSET_DATA[4, 0] = new Vector2Int(2, 0); I_OFFSET_DATA[4, 1] = new Vector2Int(0, -2); I_OFFSET_DATA[4, 2] = new Vector2Int(-2, 0); I_OFFSET_DATA[4, 3] = new Vector2Int(0, 2); O_OFFSET_DATA = new Vector2Int[1, 4]; O_OFFSET_DATA[0, 0] = Vector2Int.zero; O_OFFSET_DATA[0, 1] = Vector2Int.down; O_OFFSET_DATA[0, 2] = new Vector2Int(-1, -1); O_OFFSET_DATA[0, 3] = Vector2Int.left; }
void Awake() { mPropBlock = new MaterialPropertyBlock(); Instance = this; }