public void Awake() { Screen.SetResolution(800, ((800 * Screen.currentResolution.height) / Screen.currentResolution.width), true); Debug.Log("awake"); gameDataLocation = Application.persistentDataPath + "/the_kings_gardener.dat"; if (_m == null) { DontDestroyOnLoad(gameObject); _m = this; } else if (_m != this) { Destroy(_m); } }
public bool ChangeScene(_main owner, bool forceChange) { if (owner.currentSceneTime >= this.sceneTime || forceChange) { switch(this.sceneType) { case SceneType.Task: { switch (this.sceneSubtype) { case 1: case 2: { if (owner.currentMisses + owner.currentHits >= this.userHits) { changeScene(owner); return true; } } break; case 3: { if (owner.isFollowing) { changeScene(owner); return true; } } break; } } break; case SceneType.Pattern: { changeScene(owner); return true; } } } return false; }
void changeScene(_main owner) { this.userScore += GetScore(owner); this.userTime += owner.currentSceneTime; if (this.sceneType == SceneType.Task && this.sceneSubtype != 3) { this.sUserHits += owner.currentHits; this.sUserMisses += owner.currentMisses; } if (owner.horizontalDiff != 0) { this.horizontalDiff += (owner.horizontalDiff / (owner.currentHits + owner.currentMisses)); } if (owner.verticalDiff != 0) { this.verticalDiff += (owner.verticalDiff / (owner.currentHits + owner.currentMisses)); } if (owner.horizontalDiffDin != 0) { this.horizontalDiffDin += (owner.horizontalDiffDin / (owner.currentHits + owner.currentMisses)); } if (owner.verticalDiffDin != 0) { this.verticalDiffDin += (owner.verticalDiffDin / (owner.currentHits + owner.currentMisses)); } this.sceneNumber++; }
public bool JumpScene(_main owner, int count) { changeScene(owner); this.sceneNumber--; this.sceneNumber += count; if (this.sceneNumber < 0) { this.sceneNumber = 0; } if (this.sceneNumber > this.innerData.tasks.Count + this.innerData.patterns.Count) { return false; } return true; }
public float GetScore(_main owner) { float hitsScoring = owner.currentHits * this.scoreAddition; float accuracyScoring = owner.currentHits * this.scoreAddition * this.accuracyBonus; float dynamicsScoring = (this.rotation || this.blinkType != 0) ? owner.currentHits * this.scoreAddition * this.dynamicsBonus : 0; float sizeScoring = (this.objectScale < 1.0f) ? owner.currentHits * this.scoreAddition * this.sizeBonus : 0; return (hitsScoring + accuracyScoring + dynamicsScoring + sizeScoring); }