示例#1
0
    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;
    }
示例#2
0
 private void Awake()
 {
     if (!_starManager)
     {
         _starManager = FindObjectOfType <StarManager>();
     }
 }
示例#3
0
 public static StarManager GetInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <StarManager>();
     }
     return(instance);
 }
示例#4
0
    private void Awake()
    {
        _starManager  = FindObjectOfType <StarManager>();
        _scoreManager = FindObjectOfType <ScoreManager>();
        var saveData = SaveSystem.LoadSave <PlayerData>();

        GameData = saveData ?? new PlayerData(0, 0);
    }
示例#5
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タグのオブジェクトをすべて取得
                }
示例#6
0
 private void Awake()
 {
     instance = this;
     stars    = transform.GetComponentsInChildren <Image>();
     lives    = stars.Length;
     total    = lives;
     UpdateStars();
 }
示例#7
0
    private void CheckIfDefenderCanBeSpawn(Vector2 positionInWorldUnits)
    {
        StarManager starManager = FindObjectOfType <StarManager>();

        if (starManager.GetCurrentNumberOfStars() >= costDefender)
        {
            SpawnDefender(positionInWorldUnits);
        }
    }
示例#8
0
    void Start()
    {
        m_SpriteRenderer         = GetComponent <SpriteRenderer>();
        m_SpriteRenderer.enabled = false;
        m_Light         = GetComponent <Light>();
        m_Light.enabled = false;

        m_Manager = FindObjectOfType <StarManager>();
    }
示例#9
0
    /// <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);
    }
示例#10
0
文件: GameRoot.cs 项目: AxxAL/MyGame
 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();
 }
示例#11
0
    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];
    }
示例#12
0
 private void Start()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
     textTime.text = ((int)(maxTime)).ToString();
 }
示例#13
0
 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;
 }
示例#14
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        //DontDestroyOnLoad( gameObject );
    }
示例#15
0
    // Start is called before the first frame update
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(transform.gameObject);
        }

        UpdateStars();
    }
示例#16
0
 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();
     }
 }
示例#18
0
        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>();
    }
示例#20
0
//
//		#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>();
            }
        }
示例#21
0
    //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);
    }
示例#22
0
 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>();
     }
 }
示例#23
0
    // 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;
        }
    }
示例#25
0
 void Awake()
 {
     instance = this;
 }
 // Start is called before the first frame update
 void Start()
 {
     starManager = FindObjectOfType <StarManager>();
 }
示例#27
0
 private void Awake()
 {
     _starManager  = FindObjectOfType <StarManager>();
     _scoreManager = FindObjectOfType <ScoreManager>();
     _itemManager  = FindObjectOfType <ItemManager>();
 }
示例#28
0
 void Awake()
 {
     instance = GetComponent <StarManager>();
 }
示例#29
0
 void Awake()
 {
     _starCounter       = FindObjectOfType <StarManager>();
     _animator          = GetComponent <Animator>();
     _nextStarBirthTime = Time.time + StarBirthInterval;
 }
示例#30
0
    void Awake()
    {
        Instance = this;

        InstantiateStars();
    }