Inheritance: MonoBehaviour
Exemplo n.º 1
0
 void Awake()
 {
     playerData = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
     ac = GameObject.FindGameObjectWithTag ("AudioController").GetComponent<AudioControll> ();
     playerHealth = GameObject.FindGameObjectWithTag("PlayerHealthUI").GetComponent<PlayerHealth>();
     anim = GetComponent<Animator>();
 }
Exemplo n.º 2
0
    void Awake()
    {
        if (GameObject.Find("AudioController") == null)
        {
            ac      = Instantiate(audioControllerPrefab) as GameObject;
            ac.name = "AudioController";
        }

        audioControll = GameObject.Find("AudioController").GetComponent <AudioControll>();
    }
Exemplo n.º 3
0
    void Awake()
    {
        audioControll = GameObject.Find("AudioController").GetComponent <AudioControll> ();

        updateOn        = true;
        puz             = gameController.GetComponent <JigsawPuzzle> ();
        score_Text.text = score.ToString();
        time            = 0.0f;
        isGameEnd       = false;
    }
Exemplo n.º 4
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }
		//DontDestroyOnLoad(this.gameObject);
    }
Exemplo n.º 5
0
    // Use this for initialization
    void Awake()
    {
        getData();

        audioControll = GameObject.Find("AudioController").GetComponent <AudioControll> ();

        y_ratio = (float)Screen.height / 1280;
        x_ratio = (float)Screen.width / 800;


        isTime    = true;
        isScore   = false;
        isEasy    = true;
        isAllTime = true;
        isWeek    = false;
        isMonth   = false;


        button_allTime.interactable = false;
        button_month.interactable   = true;
        button_week.interactable    = true;

        button_time.interactable  = false;
        button_score.interactable = true;

        min_mark        = shortest_mark;
        max_mark        = longest_mark;
        mean_value_mark = mean_mark;

        min_line_ToBeUsed  = shortest;
        max_line_ToBeUsed  = longest;
        mean_line_ToBeUsed = mean;

        datehelper   = GetComponent <DateHelper> ();
        lineRenderer = GetComponent <LineRenderer> ();
        lineRenderer.SetWidth(7f, 7f);
        int_list = new List <int> (array);
        max_line_ToBeUsed.SetActive(false);
        min_line_ToBeUsed.SetActive(false);
        mean_line_ToBeUsed.SetActive(false);

        y_axis_length = y_endpoint.position.y - origin.position.y;
        x_axis_length = x_endpoint.position.x - origin.position.x;

        graph_transform           = GraphPanel.transform;
        graph_transform_for_Score = GraphPanelForScore.transform;

        transform_toBeUsed = graph_transform;
    }
Exemplo n.º 6
0
    // FB SDK
    // Awake function from Unity's MonoBehaviour
    void Awake()
    {
        audioControll = GameObject.Find("AudioController").GetComponent <AudioControll> ();

        if (!FB.IsInitialized)
        {
            // Initialise the Facebook SDK
            FB.Init(InitCallback, OnHideUnity);
        }
        else
        {
            // Already initialised, signal an app activation App Event
            FB.ActivateApp();
            Debug.Log("The Facebook SDK Initialised");
        }
    }
Exemplo n.º 7
0
    // When the script starts, get image data from "sharedObject"
    void Awake()
    {
        audioControll = GameObject.Find("AudioController").GetComponent <AudioControll> ();
        sharedObject  = GameObject.FindGameObjectsWithTag("SharedObject")[0] as GameObject;
        v             = sharedObject.GetComponent <SharedVariables> ();

        byte[] data = v.imageData;
        int    w    = v.width;
        int    h    = v.height;

        gameLevel  = v.level;
        puzzleSize = gameLevel * gameLevel;

        withTips = v.withTips;

        if (data.Length == 0 || w == 0 || h == 0)
        {
            errorBox.SetActive(true);
        }
        else
        {
            loadImage(data, w, h);
        }

        shuffle(puzzleSize);

        if (gameLevel == 2)
        {
            GameSpace_2x2.SetActive(true);
        }
        else if (gameLevel == 3)
        {
            GameSpace_3x3.SetActive(true);
        }
        else if (gameLevel == 4)
        {
            GameSpace_4x4.SetActive(true);
        }

        StartCoroutine(StartToRemember());
    }
Exemplo n.º 8
0
 void Awake()
 {
     audioCotroll = GameObject.Find("AudioController").GetComponent <AudioControll> ();
 }
Exemplo n.º 9
0
 void Awake()
 {
     gameController = GameObject.Find("GameController");
     sc             = gameController.GetComponent <ScoreControll> ();
     audioControll  = GameObject.Find("AudioController").GetComponent <AudioControll> ();
 }