private void PutSeasonStoneOnController(GrabbableSeasonStone seasonStone) { GameObject seasonStoneGameObject = seasonStone.gameObject; seasonStoneGameObject.transform.parent = this.gameObject.transform; seasonStoneGameObject.transform.localPosition = new Vector3(0, 0.05f, -0.05f); ChangeSeasonStoneScale(seasonStoneGameObject); int rotation = 0; // Put the stones at the right position around the controller if (SeasonsManager.Instance.NextSeason == seasonStone.season) { rotation = -90; } else if (SeasonsManager.Instance.PreviousSeason == seasonStone.season) { rotation = 90; } else if (SeasonsManager.Instance.CurrentSeason == seasonStone.season) { rotation = 0; } else { rotation = 180; } Vector3 rotationCenterPosition = this.transform.position + this.transform.TransformDirection(new Vector3(0, 0.04f, -0.05f)); seasonStoneGameObject.transform.RotateAround(this.transform.position, this.transform.TransformDirection(Vector3.forward), rotation); }
private void StoneTaken(GrabbableSeasonStone stone) { // changes world and object states according the the grabbed season stone if (stone.season == Season.WINTER) { soundManager.PlaySuccessClip(); grayManager.enableSector(0); springStone.gameObject.SetActive(true); summerStone.gameObject.SetActive(true); } if (stone.season == Season.SPRING) { arrow.SetActive(true); } if (stone.season == Season.SUMMER) { autumnStone.gameObject.SetActive(true); } if (stone.season == Season.AUTUMN) { grayManager.enableSector(1); tutorialDone = true; soundManager.PlaySuccessClip(); } }
public void AttachSeasonStone(GrabbableSeasonStone seasonStone) { seasonStones.Add(seasonStone.season, seasonStone.gameObject); player.SetSeasonPower(seasonStone.season, true); PutSeasonStoneOnController(seasonStone); }