void Start() { // get cards cards = cardManager.GetComponent <CardsManager>().TotalCards; // get p1/p2 if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); p1 = catManager.p1g; p2 = catManager.p2g; } else { // if there is no cat manager (aka no one selected players) then it will default to Sausage and Queso p1 = GameObject.Find("Sausage"); p2 = GameObject.Find("Queso"); } // get floor if (GameObject.Find("StageManager") != null) { stageManager = GameObject.Find("StageManager").GetComponent <StageManager>(); floor = stageManager.currentStage; } }
public void GetVariables() { cardManager = cardsManager.GetComponent <CardsManager>(); cards = new List <GameObject>(cardManager.Cards); winner = ""; if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); p1 = catManager.p1g; p2 = catManager.p2g; } else { p1 = GameObject.Find("Sausage"); p2 = GameObject.Find("Queso"); } // get floor if (GameObject.Find("StageManager") != null) { stageManager = GameObject.Find("StageManager").GetComponent <StageManager>(); floor = stageManager.currentStage; } p1s = p1.transform.localScale; p2s = p2.transform.localScale; floorScale = floor.transform.localScale; floorRotation = floor.transform.localRotation; floorPosition = floor.transform.localPosition; }
private void Start() { if (nCats) { CatManager.LaunchCats(); } else if (nyan) { CatManager.LaunchCat(); } Canvas canvas = LoadingScreen.Instance.GetComponentInChildren <Canvas>(); status = CreateTextObject(canvas, "MMStatus"); errors = CreateTextObject(canvas, "MMErrors"); warning = CreateTextObject(canvas, "MMWarning"); warning.text = ""; //if (Versioning.version_major == 1 && Versioning.version_minor == 0 && Versioning.Revision == 5 && Versioning.BuildID == 1024) //{ // warning.text = "Your KSP 1.0.5 is running on build 1024. You should upgrade to build 1028 to avoid problems with addons."; // //if (GUI.Button(new Rect(Screen.width / 2f - 100, offsetY, 200, 20), "Click to open the Forum thread")) // // Application.OpenURL("http://forum.kerbalspaceprogram.com/index.php?/topic/124998-silent-patch-for-ksp-105-published/"); //} }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); levelManager = GetComponent <LevelManager> (); boardManager = GetComponent <BoardManager> (); clickManager = GetComponent <ClickManager> (); gopherManager = GetComponent <GopherManager> (); catManager = GetComponent <CatManager> (); dogManager = GetComponent <DogManager> (); dogCatcherManager = GetComponent <DogCatcherManager> (); policeManager = GetComponent <PoliceManager> (); bloodHoundManager = GetComponent <BloodhoundManager> (); militaryManager = GetComponent <MilitaryManager> (); enemyMilitaryManager = GetComponent <EnemyMilitaryManager> (); audioManager = GetComponent <AudioSource> (); managers.Add(gopherManager); managers.Add(catManager); managers.Add(dogManager); managers.Add(dogCatcherManager); managers.Add(policeManager); managers.Add(bloodHoundManager); managers.Add(militaryManager); managers.Add(enemyMilitaryManager); Screen.SetResolution(800, 800, false); }
public void CatManager_CallingThirdPartyAPI_IS_NOT_NULL() { ICatManager cm = new CatManager(); var result = cm.GetCatNameListByOwnerGender(); Assert.IsNotNull(result); Assert.IsNotNull(result.Result); }
private void Awake() { if (Instance != null) { Destroy(this); return; } Instance = this; }
void Start() { #region Learning and Test //Created a unityaction to assign to the button and remove when needed. unPauseAction = () => { _Unpause(); }; //First attempt at making the dialog box function dialogWindowRef = eventDialogWindow.GetComponent <EventDialog>(); #endregion #region UIChecks if (uiDistSlider == null) { Debug.LogWarning("No Slider Assigned on GameController"); } else { uiDistSlider.maxValue = curGoalDistance; } if (uiLevelCompletePanel == null) { Debug.LogWarning("No LevelComplete Panel Assigned to GameController Script!"); } if (uiDistGoalText == null) { Debug.Log("No Dist goal text assigned to the GameController script."); } else { uiDistGoalText.text = curGoalDistance.ToString(); } #endregion #region ScriptReferences catManager = GetComponent <CatManager>(); #endregion if (playerObj == null) { playerObj = GameObject.FindGameObjectWithTag("Player"); canTravel = true; } else { canTravel = true; } //Load Map Debug.Log("Loading first map."); GetComponent <TileLoader>().LoadMap(level1); //Initialize Cats catManager.InitializeCaravan("Papa", "Mama"); }
private void OnEnable() { // if cat manager exists if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); // get player one and player 2 // if needed add the playerOneMovement script // enable the cats on the enable of sample game foreach (var cat in catManager.cats) { if (cat.tag == "currentp1") { if (cat.GetComponent <PlayerOneMovement>() == null) { cat.AddComponent <PlayerOneMovement>(); } cat.gameObject.SetActive(true); } if (cat.tag == "currentp2") { if (cat.GetComponent <PlayerTwoMovement>() == null) { cat.AddComponent <PlayerTwoMovement>(); } cat.gameObject.SetActive(true); } } } // otherwise make p1/p2 sausage/queso else { if (sausage.GetComponent <PlayerOneMovement>() == null) { sausage.AddComponent <PlayerOneMovement>(); } sausage.SetActive(true); if (queso.GetComponent <PlayerTwoMovement>() == null) { queso.AddComponent <PlayerTwoMovement>(); } queso.SetActive(true); } // make each scripts catmanager equal to this catmanager and run their functions // this is needed because the scripts weren't able to find catmanager this.GetComponent <WinSampleGame>().catManager = catManager; this.GetComponent <WinSampleGame>().GetVariables(); this.GetComponent <applyMinor>().catManager = catManager; this.GetComponent <applyMinor>()._ApplyMinor(); this.GetComponent <ApplyModifiers>().catManager = catManager; this.GetComponent <ApplyModifiers>().applyModifiers(); this.GetComponent <WinSampleGame>().catManager = catManager; }
private void Awake() { Instance = this; for (int i = 0; i < DataManager.Instance.Cats.Length; i++) { statuses.Add(DataManager.Instance.Cats[i], new CatStatus() { MoodValue = 0.5f, Mood = Mathf.RoundToInt(0.5f * (MoodColors.Length - 1)) }); } Load(); }
/// <summary> /// Get and Create All Categorisation /// </summary> /// <returns>List of <see cref="ICategorisationObject"/></returns> public List <ICategorisationObject> _GetCategorisation() { try { if (CatManager == null) { CatManager = MappingConfiguration.MetadataFactory.InstanceCategoriesManager(this.ParsingObject, this.VersionTypeResp); } return(CatManager.GetCategorisation()); } catch (SdmxException) { throw; } catch (Exception ex) { throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.BuildCategoryScheme, ex); } }
private void Awake() { initialPosition = this.transform.position; if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); p1g = catManager.p1g; p2g = catManager.p2g; } else { p1g = GameObject.Find("Sausage"); p2g = GameObject.Find("Queso"); } }
private void LateUpdate() { // get managers if (GameObject.Find("SettingsManager") != null && GameObject.Find("DevModeManager").GetComponent <developerMode>().devMode == false) { settings = GameObject.Find("SettingsManager").GetComponent <AllSettings>(); pointsToWin = settings.pointsToWin; } if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); p1 = catManager.p1g; p2 = catManager.p2g; } else if (GameObject.Find("Sausage") != null) { p1 = GameObject.Find("Sausage"); p2 = GameObject.Find("Queso"); } }
public void applyModifiers() { // get managers if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); p1 = catManager.p1g; p2 = catManager.p2g; } else { p1 = sausage; p2 = queso; } if (GameObject.Find("DevModeManager").GetComponent <developerMode>().devMode == false) { getSettings(); } // multiply cats size by modifier p1.transform.localScale *= catSize; p2.transform.localScale *= catSize; // multiply cats speed by modifier p1.GetComponent <PlayerOneMovement>().speed *= catSpeed; p2.GetComponent <PlayerTwoMovement>().speed *= catSpeed; // multiply cats jumps by modifer p1.GetComponent <PlayerOneMovement>().jumpHeight *= catJumps; p2.GetComponent <PlayerTwoMovement>().jumpHeight *= catJumps; // if thinplatform is true then make the platform 1/4x the thickness if (thinPlatform) { floor.transform.localScale = new Vector3(floor.transform.localScale.x, floor.transform.localScale.y * 0.25f, floor.transform.localScale.z); } }
private void Start() { if (nCats) { CatManager.LaunchCats(); } else if (nyan) { CatManager.LaunchCat(); } Canvas canvas = LoadingScreen.Instance.GetComponentInChildren <Canvas>(); status = CreateTextObject(canvas, "MMStatus"); errors = CreateTextObject(canvas, "MMErrors"); warning = CreateTextObject(canvas, "MMWarning"); warning.text = ""; //if (Versioning.version_major == 1 && Versioning.version_minor == 0 && Versioning.Revision == 5 && Versioning.BuildID == 1024) //{ // warning.text = "Your KSP 1.0.5 is running on build 1024. You should upgrade to build 1028 to avoid problems with addons."; // //if (GUI.Button(new Rect(Screen.width / 2f - 100, offsetY, 200, 20), "Click to open the Forum thread")) // // Application.OpenURL("http://forum.kerbalspaceprogram.com/index.php?/topic/124998-silent-patch-for-ksp-105-published/"); //} if (Versioning.version_major == 1 && Versioning.version_minor >= 8) { foreach (AssemblyLoader.LoadedAssembly assembly in AssemblyLoader.loadedAssemblies) { AssemblyName assemblyName = assembly.assembly.GetName(); if (assemblyName.Name == "Firespitter" && assemblyName.Version <= Version.Parse("7.3.7175.38653")) { warning.text = "You are using a version of Firespitter that does not run properly on KSP 1.8+\nThis version may prevent the game from loading properly and may create problems for other mods"; } } } }
public void _ApplyMinor() { // get managers if (GameObject.Find("CatManager") != null) { catManager = GameObject.Find("CatManager").GetComponent <CatManager>(); cats = catManager.cats; } // apply effect based off of the name of the cat isApplied = false; if (isApplied == false) { foreach (var cat in cats) { switch (cat.name) { case "Sausage": // faster vertically ApplyMinor(sausageSpeed, sausageJump, cat); break; case "Queso": // a little slower all around ApplyMinor(quesoSpeed, quesoJump, cat); break; case "JohnJonJean": // a little slower all around ApplyMinor(jjjSpeed, jjjJump, cat); break; case "OwO": // a little faster all around ApplyMinor(owoSpeed, owoJump, cat); break; case "Jupiter": // higher jumps ApplyMinor(jupiterSpeed, jupiterJump, cat); break; case "Gwendoline": // same as now ApplyMinor(gwendolineSpeed, gwendolineJump, cat); break; case "Igor": // higher jumps ApplyMinor(igorSpeed, igorJump, cat); break; case "Texas": ApplyMinor(texasSpeed, texasJump, cat); // higher jumps break; case "Washington": // a little faster all around ApplyMinor(washingtonSpeed, washingtonJump, cat); break; case "Qwerty": // super fast all around ApplyMinor(qwertySpeed, qwertyJump, cat); break; case "Toothpick": // same as now ApplyMinor(toothpickSpeed, toothpickJump, cat); break; } } } isApplied = true; }
// Start is called before the first frame update void Start() { Instance = this; checkIfFinished = true; }
void Start() { catManager = GameObject.FindGameObjectWithTag(Tags.CAT_MANAGER).GetComponent<CatManager>(); this.originalTimeForMeter = timeForMeter; }