예제 #1
0
    /// <summary>
    /// Initializes the character scroll panel.
    /// </summary>
    private void InitializeCharacterScrollPanel(GameSceneMaster sceneMaster)
    {
        // Initialize scroll panel
        m_characterSelectPanel.Initialize(false, false);
        // Populate character list
        GameObject[] prefabs = m_characterResource.GetCharacterPrefabs();
        for (int index = 0; index < prefabs.Length; ++index)
        {
            // Instantiate character
            Character character = m_characterResource.CreateCharacter((CharacterType)index);
            // Create scroll item
            UIScrollItem newItem = m_characterSelectPanel.CreateScrollItem();
            // Child character under scroll item
            character.transform.parent = newItem.transform;
            // Position character "behind" the scroll item
            character.transform.localPosition = new Vector3(0.0f, 0.0f, m_normalCharLocalPosZ);
            // Set initial rotation
            character.transform.eulerAngles = m_initialRotation;
            // Set normal scale
            character.transform.localScale = Vector3.one * m_normalCharScale;
            // Add scroll item to scroll panel
            m_characterSelectPanel.AddScrollItem(newItem);

            // Set the character layer and sorting layer to UI
            character.ModelRenderer.gameObject.layer = LayerMask.NameToLayer(m_scrollItemLayer);
            character.ModelRenderer.sortingLayerName = m_scrollItemSortingLayer;
            character.ModelRenderer.sortingOrder     = m_scrollItemSortingOrder;

            // Attach a CharacterSelectItem component to allow handling from CharacterSelectUI
            CharacterSelectItem charSelectItem = newItem.gameObject.AddComponentNoDupe <CharacterSelectItem>();
            bool isUsed  = sceneMaster.IsUsed((CharacterType)index);
            bool isOwned = sceneMaster.IsOwned((CharacterType)index);
            charSelectItem.Initialize(this, newItem, character, isUsed, isOwned,
                                      m_ownedCharRotSpeed, m_normalCharScale, m_focusCharScale,
                                      m_focusCharAnimTime, m_focusCharPosition, m_newCharWinAnim,
                                      m_newCharAnimReference);
            if (!m_charSelectItemList.Contains(charSelectItem))
            {
                m_charSelectItemList.Add(charSelectItem);
            }
            // Update the number of used characters (those that have been equipped by the player at least once)
            if (isUsed)
            {
                m_usedCharCount++;
            }
            // Update the number of owned characters
            if (isOwned)
            {
                m_ownedCharCount++;
            }
        }
    }
예제 #2
0
    void Start()
    {
        gameManager         = GameObject.Find("GameManager").GetComponent <GameSceneMaster>();
        gameManager.floater = this;

        for (int i = 0; i < gameManager.birds.Length; i++)
        {
            const float offset   = 7;
            Vector3     position = gameManager.birds[i].transform.position + Vector3.up * offset;

            pulsePosition[i] = Camera.main.WorldToScreenPoint(position);
        }

        for (int i = 0; i < 4; i++)
        {
            SpawnPrecisionFeedback(i);
        }
    }
예제 #3
0
	void Start ()
	{
		gameManager = GameObject.Find("GameManager").GetComponent<GameSceneMaster>();
		gameManager.floater = this;

		for (int i = 0; i < gameManager.birds.Length; i++)
		{
			const float offset = 7;
			Vector3 position = gameManager.birds[i].transform.position + Vector3.up*offset;

			pulsePosition[i] = Camera.main.WorldToScreenPoint(position);
		}

		for (int i = 0; i < 4; i++)
		{
			SpawnPrecisionFeedback(i);
		}
	}
예제 #4
0
    // Use this for initialization
    void Start()
    {
        startPressed = false;

        gameManager = GameObject.Find("GameManager").GetComponent <GameSceneMaster>();
        initialLogoLocalPosition = LogoGameObject.transform.localPosition;
        //curtainDownPos = curtainTransform.position;

        debugControllerInput = new ControllerInput(1);

        stageCamera = GetComponent <StageCamera>();

        targetBalconyBirdPos        = balconyObjects.balconyBird.transform.localPosition;
        targetBalconyLightIntensity = balconyObjects.balconySpotlight.intensity;
        targetBalconyLightSpotAngle = balconyObjects.balconySpotlight.spotAngle;


        stageCamera.cameraFocalPoint.position = LogoGameObject.transform.position;
    }
예제 #5
0
	// Use this for initialization
	void Start ()
	{
		startPressed = false;

		gameManager = GameObject.Find("GameManager").GetComponent<GameSceneMaster>();
		initialLogoLocalPosition = LogoGameObject.transform.localPosition;
		//curtainDownPos = curtainTransform.position;

		debugControllerInput = new ControllerInput(1);

		stageCamera = GetComponent<StageCamera>();

		targetBalconyBirdPos = balconyObjects.balconyBird.transform.localPosition;
		targetBalconyLightIntensity = balconyObjects.balconySpotlight.intensity;
		targetBalconyLightSpotAngle = balconyObjects.balconySpotlight.spotAngle;


		stageCamera.cameraFocalPoint.position= LogoGameObject.transform.position;
	}
예제 #6
0
    /// <summary>
    /// Initializes this instance.
    /// </summary>
    public void Initialize(GameSceneMaster sceneMaster,
                           NewCharWinAnimator newCharWinAnim,
                           Vector3 initialCharacterRotation,
                           CharacterResource characterResource,
                           System.EventHandler <System.EventArgs> playCharacterDelegate,
                           System.EventHandler <System.EventArgs> buyCharacterDelegate,
                           System.EventHandler <System.EventArgs> charSelectShareDelegate,
                           System.Action <int> ownedCharCountChangedDelegate,
                           System.EventHandler <System.EventArgs> pressSoundDelegate,
                           System.EventHandler <System.EventArgs> releaseSoundDelegate)
    {
        m_newCharWinAnim = newCharWinAnim;

        // Set the initial rotation for characters in character select
        m_initialRotation = initialCharacterRotation;

        // Initialize buttons
        m_playCharacterBtn.Initialize(playCharacterDelegate, UIButton.TriggerType.ON_RELEASE);
        m_buyCharacterBtn.Initialize(buyCharacterDelegate, UIButton.TriggerType.ON_RELEASE);
        m_charSelectShareBtn.Initialize(charSelectShareDelegate, UIButton.TriggerType.ON_RELEASE);
        // Set button sounds
        m_playCharacterBtn.AddSoundDelegates(pressSoundDelegate, releaseSoundDelegate);
        m_buyCharacterBtn.AddSoundDelegates(pressSoundDelegate, releaseSoundDelegate);
        m_charSelectShareBtn.AddSoundDelegates(pressSoundDelegate, releaseSoundDelegate);

        // Store delegate for when number of owned characters changes
        m_ownedCharCountChangedDelegate = ownedCharCountChangedDelegate;

        // Initialize text
        m_characterNameText.Initialize();
        m_characterPriceText.Initialize();
        m_characterCountText.Initialize();

        // Initialize character list
        m_characterResource = characterResource;
        InitializeCharacterScrollPanel(sceneMaster);

        UpdateCharacterCountText();

        // Set the initialized flag
        m_isInitialized = true;
    }
예제 #7
0
 private void Start()
 {
     stebGlobal = this;
     Globals.Init(poses);
     gameManager = GameObject.Find("GameManager").GetComponent <GameSceneMaster>();
 }
예제 #8
0
	private void Start()
	{
		stebGlobal = this;
		Globals.Init( poses );
		gameManager = GameObject.Find("GameManager").GetComponent<GameSceneMaster>();
	}