Пример #1
0
    void Start()
    {
        headAngles    = new Vector3[numberOfMovements];
        index         = 0;
        startingAngle = Camera.main.transform.eulerAngles;
        InvokeRepeating("MeasureHeadAngle", 0f, .001f);
        InvokeRepeating("ResetMovement", 0f, 5f);

        dialogue = GameObject.FindGameObjectWithTag("Dialogue").GetComponent <DialogueManager>();
        story    = GameObject.FindGameObjectWithTag("MainLogic").GetComponent <ReadStory>();
        dialogue.AddSentence(story.parts[story.getIndex()]);
    }
Пример #2
0
    void Awake()
    {
        try
        {
            string       line;
            StreamReader theReader = new StreamReader(path, Encoding.Default);
            using (theReader)
            {
                do
                {
                    line = theReader.ReadLine();
                    if (line != null)
                    {
                        parts.Add(line);
                    }
                } while (line != null);
            }
        } catch (Exception e)
        {
            Console.WriteLine("{0}\n", e.Message);
            return;
        }
        //for (int i = 0; i < parts.Count; ++i)
        //    Debug.Log(parts[i]);

        //Dont Destroy
        if (current != null && current != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            current = this;
        }
        DontDestroyOnLoad(this.gameObject);
    }