public IEnumerator GetOnStar(float time, GameObject star) { CanMove = false; float t = 0; Camera.LookAt = CamStarLookAtTarget; Camera.m_BindingMode = CinemachineTransposer.BindingMode.LockToTarget; while (t < time) { float percentage = t / time; Vector3 movePos = new Vector3(star.transform.position.x, transform.position.y, star.transform.position.z); float dist = Vector3.Distance(transform.position, movePos); transform.position = Vector3.MoveTowards(transform.position, movePos, dist / 20); float yPos = star.transform.position.y * HopCurve.Evaluate(percentage); transform.position = new Vector3(transform.position.x, yPos, transform.position.z); t += Time.deltaTime; yield return(new WaitForEndOfFrame()); } transform.parent = star.transform; EnvironmentCollider.enabled = false; rb.velocity = Vector3.zero; Vector3 rot = new Vector3(0, star.transform.localEulerAngles.y, 0); transform.localEulerAngles = rot; StarBody = star.GetComponent <Rigidbody>(); Star = star.GetComponent <StarManager>(); Star.manager = this; }
private void Awake() { if (!_starManager) { _starManager = FindObjectOfType <StarManager>(); } }
public static StarManager GetInstance() { if (instance == null) { instance = FindObjectOfType <StarManager>(); } return(instance); }
private void Awake() { _starManager = FindObjectOfType <StarManager>(); _scoreManager = FindObjectOfType <ScoreManager>(); var saveData = SaveSystem.LoadSave <PlayerData>(); GameData = saveData ?? new PlayerData(0, 0); }
private Vector2 canvasSize; // Canvasのサイズ private void Start() { constellationLineManager = GetComponent <ConstellationLineManager>(); guideLineManager = GetComponent <GuideLineManager>(); starManager = GetComponent <StarManager>(); canvasSize = canvasRectTransform.sizeDelta; // キャンバスの大きさを取得 stars = GameObject.FindGameObjectsWithTag("Star"); // Starタグのオブジェクトをすべて取得 }
private void Awake() { instance = this; stars = transform.GetComponentsInChildren <Image>(); lives = stars.Length; total = lives; UpdateStars(); }
private void CheckIfDefenderCanBeSpawn(Vector2 positionInWorldUnits) { StarManager starManager = FindObjectOfType <StarManager>(); if (starManager.GetCurrentNumberOfStars() >= costDefender) { SpawnDefender(positionInWorldUnits); } }
void Start() { m_SpriteRenderer = GetComponent <SpriteRenderer>(); m_SpriteRenderer.enabled = false; m_Light = GetComponent <Light>(); m_Light.enabled = false; m_Manager = FindObjectOfType <StarManager>(); }
/// <summary> /// pos位置坐标 /// index只的是克隆的第几个物体 /// newLevel判断是否是新关卡 /// </summary> /// <param name="index"></param> /// <param name="newLevel"></param> /// <param name="up"></param> Transform CloneGrah(int pos) { StarManager clone = Instantiate(chapter[pos % chapter.Count], group); clone.transform.localScale = Vector3.one; clone.GetComponent <RectTransform> ().anchoredPosition = new Vector2(0, pos * 1280 + (contentOffset + startOffset)); clone.GetComponent <StarManager> ().SetStarBg(GetBgUrl(pos % chapter.Count), graphBg[pos % graphBg.Count]); clone.GetComponent <StarManager> ().SetButtonState(pos == Prefs.unlockedWorld); return(clone.transform); }
protected override void Initialize() { this.enemyManager = new EnemyManager(this); this.player = new Player(this); this.hud = new HUD(this); this.healthPackManager = new HealthPackManager(this); this.menu = new Menu(this); this.starManager = new StarManager(this); this.Music(); base.Initialize(); }
private void Initialize() { starManager = FindObjectOfType <StarManager>(); UIPlanetSelector = FindObjectOfType <PlanetSelector>(); layerRotationController = FindObjectOfType <LayerRotationController>(); layerRotationController.layers = new Transform [Planets.Length]; UIPlanetPositions = new Vector3 [Planets.Length]; UIPlanetSelector.planets = new GameObject[Planets.Length]; OrbitInstances = new GameObject[Planets.Length]; }
private void Start() { if (instance != null) { Destroy(this.gameObject); } else { instance = this; } textTime.text = ((int)(maxTime)).ToString(); }
void Awake() { //HAKEE KOMPONENTIT rb2d = GetComponent <Rigidbody2D>(); cf2d = GameObject.Find("Main Camera").GetComponent <CameraFollow2d>(); dthManager = GameObject.Find("ScriptBlock").GetComponent <DeathManager>(); goManager = GameObject.Find("ScriptBlock").GetComponent <GameOverManager>(); starManager = GameObject.Find("ScriptBlock").GetComponent <StarManager>(); soundManager = GameObject.Find("ScriptBlock").GetComponent <SoundManager>(); lvlManager = GameObject.Find("ScriptBlock").GetComponent <LevelManager>(); motorFire = this.gameObject.transform.GetChild(0).gameObject; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } //DontDestroyOnLoad( gameObject ); }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } else { Destroy(transform.gameObject); } UpdateStars(); }
void Awake() { starManager = GameObject.FindGameObjectWithTag(Tags.STAR_MANAGER).GetComponent <StarManager>(); if (gamePanel != null) { buttonContainer = gamePanel.GetComponentsInChildren <QuizButton> (); questionLabel = gamePanel.GetComponentInChildren <QuizQuestionLabel> (); } if (quizPanel != null) { quizPanelCanvasGroup = quizPanel.GetComponent <CanvasGroup>(); } }
public void Init() { instance = this; tr = transform; radius = GetComponent <CircleCollider2D>().bounds.size.x / 2; for (int i = 0; i < starCount; i++) { Vector2 randomPoint = Mathf2.SelectRandomPoint(radius); Vector3 randomPos = new Vector3(randomPoint.x + PlayerCharacter.instance.tr.position.x, randomPoint.y + PlayerCharacter.instance.tr.position.y, UnityEngine.Random.Range(10, 30)); GameObject star = GameObject.Instantiate(starObj, randomPos, Quaternion.identity); star.transform.SetParent(starRoot.transform); star.GetComponent <SpriteRenderer>().color = Random.ColorHSV(); } }
public static async Task MakeStar() { var postManager = new PostManager(_webManager); var starManager = new StarManager(_webManager); var files = await postManager.CreateNewFileSessionAsync(); var result = await postManager.GetUsersPostsAsync(); var post = result.Data.Posts.First(); var star = await starManager.StarByteAsync(post.Id); var results = await starManager.GetStarsAsync(); var deleteStar = await starManager.DeleteStarOnByteAsync(post.Id); }
// Start is called before the first frame update void Awake() { width = (float)Screen.width; _minSwipeDistance = Screen.height * _minSwipeDistanceInPercentage; // 10% height of the screen //Get the Animator attached to the Timmy's Model timmyAnimator = GameObject.Find("Timmy_fbx").GetComponent <Animator>(); _starManager = FindObjectOfType <StarManager>(); LevelEnd = false; //if (_isFountain) // _fountainGameController = FindObjectOfType<FountainGameController>(); gc = GameObject.FindObjectOfType <GameControl>(); }
// // #region DELEGATE AND EVENTS // public delegate void OnButtonSingleClickDelegate (string id); // public static event OnButtonSingleClickDelegate buttonSingleClickDelegate; // public delegate void OnButtonDoubleClickDelegate (string id); // public static event OnButtonDoubleClickDelegate buttonDoubleClickDelegate; // // #endregion // #region SYSTEM METHODS void Awake() { gameWordsRootPanel = GameObject.FindGameObjectWithTag(Tags.GAME_WORDS_ROOT_PANEL); gamePanel = GameObject.FindGameObjectWithTag(Tags.GAME_PANEL); starManager = GameObject.FindGameObjectWithTag(Tags.STAR_MANAGER).GetComponent <StarManager>(); if (gamePanel != null) { questionPanel = GameObject.FindGameObjectWithTag(Tags.QUESTIONS_PANEL); cellsContainer = GameObject.FindGameObjectWithTag(Tags.CELLS).GetComponent <CellPlaceHolder>(); character = GameObject.FindGameObjectWithTag(Tags.CHARACTER).GetComponent <Image>(); checkButton = GameObject.FindGameObjectWithTag(Tags.CHECK_BUTTON).GetComponent <Button>(); } if (gameWordsRootPanel != null) { gameWordsPanelCanvasGroup = gameWordsRootPanel.GetComponent <CanvasGroup>(); } }
//Awake is always called before any Start functions void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a StarManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }
void Awake() { transform.tag = Tags.CLASSIFICATION_UI_MANAGER; LoadActorSprites(actorSpritePath); Debug.Log("ACTOR SPRITES LOADED IN CLASSIFICATION UI MANAGER"); gameWordsRootPanel = GameObject.FindGameObjectWithTag(Tags.CLASSIFICATION_ROOT_PANEL); gamePanel = GameObject.FindGameObjectWithTag(Tags.CLASSIFICATION_GAME_PANEL); starManager = GameObject.FindGameObjectWithTag(Tags.STAR_MANAGER).GetComponent <StarManager>(); if (gamePanel != null) { questionPanel = GameObject.FindGameObjectWithTag(Tags.CLASSIFICATION_QUESTION_PANEL); questionLabel = questionPanel.GetComponentInChildren <ClassificationQuestionLabel>(); actorsPanel = GameObject.FindGameObjectWithTag(Tags.CLASSIFICATION_ACTORS_PANEL); actorsContainer = actorsPanel.GetComponentsInChildren <Actor>(); //GameObject.FindGameObjectsWithTag(Tags.CLASSIFICATION_ACTOR).OrderBy (g => g.name).ToArray (); checkButton = GameObject.FindGameObjectWithTag(Tags.CLASSIFICATION_CHECK_BUTTON).GetComponent <Button>(); } if (gameWordsRootPanel != null) { gameWordsPanelCanvasGroup = gameWordsRootPanel.GetComponent <CanvasGroup>(); } }
// Start is called before the first frame update void Awake() { //Get the Animator attached to the Timmy's Model m_Animator = GameObject.Find("Timmy_fbx").GetComponent <Animator>(); _endGameObject.SetActive(false); leftHandObjects = new Queue <ThrowableObject>(); rightHandObjects = new Queue <ThrowableObject>(); addBall = GetComponent <AddBall>(); StartGameSpeed = gameSpeed; Time.timeScale = gameSpeed; _starManager = FindObjectOfType <StarManager>(); inputController = FindObjectOfType <InputController>(); inputController.ThrowEvent.AddListener(UpdateStars); AkSoundEngine.PostEvent("sun_event", gameObject); AkSoundEngine.SetState("dia_lang", "EN"); numberOfObjectsSpawn = 0; LightStageModifier = GetComponent <LightStageModifier>(); }
void Awake() { if (IsAvailable) { _thisBtn = gameObject.GetComponent <DefenderSelectButton>(); _buttonArray = FindObjectsOfType <DefenderSelectButton>().Where(b => b.IsAvailable).ToArray(); _starManager = FindObjectOfType <StarManager>(); var costText = transform.FindChild("CostText"); if (costText) { costText.GetComponent <Text>().text = DefenderPrefab.GetComponent <Defender>().Cost.ToString(); } else { Debug.LogWarning(name + " has no Cost display."); } } else { this.enabled = GetComponent <Collider2D>().enabled = false; GetComponent <SpriteRenderer>().color = DisabledColor; } }
void Awake() { instance = this; }
// Start is called before the first frame update void Start() { starManager = FindObjectOfType <StarManager>(); }
private void Awake() { _starManager = FindObjectOfType <StarManager>(); _scoreManager = FindObjectOfType <ScoreManager>(); _itemManager = FindObjectOfType <ItemManager>(); }
void Awake() { instance = GetComponent <StarManager>(); }
void Awake() { _starCounter = FindObjectOfType <StarManager>(); _animator = GetComponent <Animator>(); _nextStarBirthTime = Time.time + StarBirthInterval; }
void Awake() { Instance = this; InstantiateStars(); }