Пример #1
0
    void Update()
    {
        if (!theItemNow)
        {
            return;
        }

        theItemNow.OnItemUpdate();

        if (theItemNow.isEnd)
        {
            theItemNow.OnEndtheItem();
            indexNow++;
            if (indexNow >= thePlotItems.Count)
            {
                theItemNow = null;
                try{ UnityEngine.SceneManagement.SceneManager.LoadScene(systemValues.getNextStoryScene()); }
                catch { print("not a scene"); }
            }
            else
            {
                makePlay(thePlotItems [indexNow]);
            }
        }


        if ((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)) && !systemValues.isSystemUIUsing())
        {
            theItemNow.OnControlEnd();
        }
    }
Пример #2
0
 //没办法,接口默认pulic
 //开始的时候统一调用
 public void OnStart(plotItem theItem)
 {
     if (theSouce)
     {
         theSouce.PlayOneShot(theClip);
     }
 }
Пример #3
0
 //没办法,接口默认pulic
 //开始的时候统一调用
 public void OnStart(plotItem theItem)
 {
     theAnimator = thePlayer.GetComponentInChildren <Animator> ();
     if (theAnimator)
     {
         theAnimator.Play(theStateName);
     }
 }
Пример #4
0
 public void makePlay(plotItem theItem)
 {
     if (theItem)
     {
         theItemNow = theItem;
         //说起来这也就是两段的初始化了
         theItem.OnStart(theTextForTalk, theHeadPicture1, theHeadPicture2);
         theItem.OnPlaytheItem();
     }
 }
Пример #5
0
 //没办法,接口默认pulic
 //开始的时候统一调用
 public void OnStart(plotItem theItem)
 {
     if (theSouce && theClip)
     {
         if (theSouceForOne)
         {
             theSouceForOne.Stop();
         }
         theSouceForOne      = theSouce;
         theSouceForOne.clip = theClip;
         theSouceForOne.loop = true;
         theSouceForOne.Play();
     }
     print("print the back music");
 }
Пример #6
0
    //没办法,接口默认pulic
    //开始的时候统一调用
    public void OnStart(plotItem theItem)
    {
        if (!theShowImage)
        {
            return;
        }

        theShowImage.timer = theItem.theTimeForThisItem;
        if (isIn)
        {
            theShowImage.makeStart();
        }
        else
        {
            theShowImage.makeEnd();
        }
    }
Пример #7
0
    //没办法,接口默认pulic
    //开始的时候统一调用
    public void OnStart(plotItem theItem)
    {
        thePlotItemForThis = theItem;

        if (string.IsNullOrEmpty(speakerTalk))
        {
            thePlotItemForThis.theTextForTalk.transform.parent.gameObject.SetActive(false);
        }
        else
        {
            thePlotItemForThis.theTextForTalk.transform.parent.gameObject.SetActive(true);
        }

        timerWait     = speakerTalk.Length == 0 ? 0.01f : theItem.theTimeForThisItem * 0.75f / speakerTalk.Length;
        theShowString = speakerName + "\n";
        thePlotItemForThis.theTextForTalk.text = theShowString;
        InvokeRepeating("showTheTextWithUpdate", 0f, timerWait);

        thePlotItemForThis.HeadImage1.sprite = loadHeadImage(speakerName);
        thePlotItemForThis.HeadImage2.sprite = loadHeadImage("noOne");
    }
Пример #8
0
    //没办法,接口默认pulic
    //开始的时候统一调用
    public void OnStart(plotItem theItemIn)
    {
        Vector3 newVector = theTransToControl.localRotation.eulerAngles + new Vector3(0f, YAxisRotateAngle, 0f);

        theAimQuaternion = Quaternion.Euler(newVector);
        //print ("aim r = "+theAimQuaternion.eulerAngles);
        theItem = theItemIn;

        speedForRotate = theItem.theTimeForThisItem == 0 ? 0f : 1f / theItem.theTimeForThisItem;

        if (theAimTransform && theTransToControl)
        {
            if (theItem.theTimeForThisItem > 0)
            {
                speedForMove = Vector3.Distance(theTransToControl.position, theAimTransform.position) / (theItem.theTimeForThisItem * 0.8f);
            }
            else
            {
                speedForMove = 0f;
            }
        }
    }