public void EndFlash()
    {
        if (BlinkObject != null)
        {
            BlinkObject.SetActive(ActiveAtEnd);
            flashState = !flashState;
        }
        if (BlinkRenderer != null)
        {
            BlinkRenderer.enabled = (ActiveAtEnd);
            flashState            = !flashState;
        }
        //reset timers
        curFreq    = 0f;
        curCounter = 0f;
        curDelay   = 0f;
        //unregister
        UpdateMaster.Deregister(this as IUpdateSlave);
        isFlashing = false;

        GameObjectOperations.EnableDisableGameObjects(enableAtEnd, true);
        GameObjectOperations.EnableDisableGameObjects(disableAtEnd, false);

        if (disableSelfAtEnd)
        {
            this.gameObject.SetActive(false);
        }
    }
Exemplo n.º 2
0
 void HideAllObjects()
 {
     foreach (ObjectNamePair p in emotions)
     {
         //disable all subobjects byDefault...
         GameObjectOperations.EnableDisableGameObjects(p.gObject, false);
     }
 }
 protected virtual void gameObjectOperations(Train train)
 {
     GameObjectOperations.To(main)
     .Hide()
     .SetRotation(train.gameObject);
     GameObjectOperations.To(train.gameObject)
     .SetParent(main)
     .SetPosition(main);
 }
Exemplo n.º 4
0
 private void Awake()
 {
     if (!invertOnAwake)
     {
         return;
     }
     GameObjectOperations.EnableDisableGameObjects(enableOnSelect, false);
     GameObjectOperations.EnableDisableGameObjects(disableOnSelect, true);
 }
Exemplo n.º 5
0
    //Use format:
    //</Action/NameInObjectList/
    // Update is called once per frame
    void Update()
    {
        if (lastLine != ScreenplayReader.instance.GetCurrentLineValue())
        {
            lastLine = ScreenplayReader.instance.GetCurrentLineValue();
            //end and  hide all objects if is not reading.
            if (ScreenplayReader.instance.CheckIfIsReading() == false)
            {
                HideAllObjects();
                return;
            }
            prescriptActions = ScreenplayReader.instance.GetCurrentSentenceUnitData().prescriptActions.ToArray();
            if (prescriptActions != null)
            {
                foreach (PrescriptAction psAction in prescriptActions)
                {
                    //not enough data, so move along...
                    if (psAction.dataPack.Length < 1)
                    {
                        continue;
                    }

                    //has enough data, proccess:
                    if (psAction.dataPack[0].ToLower() == Action.ToLower())
                    {
                        if (psAction.dataPack[1].ToLower() == hideAction.ToLower())
                        {
                            HideAllObjects();
                            continue;
                        }
                        //not enough data, so move along...
                        if (psAction.dataPack.Length < 2)
                        {
                            continue;
                        }

                        //enable an objects based on the requested data.
                        if (psAction.dataPack[1].ToLower() == ActorName.ToLower())
                        {
                            int parseData = -1;
                            if (int.TryParse(psAction.dataPack[2], out parseData))
                            {
                                //enable object by emotion id
                                GameObjectOperations.EnableDisableObjectNamePair(emotions, parseData, true);
                            }
                            else
                            {
                                //Enable by name of emotion
                                GameObjectOperations.EnableDisableObjectNamePair(emotions, psAction.dataPack[2], true);
                            }
                        }
                    }
                }
            }
        }
    }
 //register/un-register
 void OnEnable()
 {
     if (UpdateOnEnable)
     {
         if (isFlashing)
         {
             return;
         }
         UpdateMaster.Register(this as IUpdateSlave);
         isFlashing = true;
         GameObjectOperations.EnableDisableGameObjects(enableAtStart, true);
         GameObjectOperations.EnableDisableGameObjects(disableAtStart, false);
     }
 }
 public void BeginFlash(float lastsFor, float rate, bool showAtEnd, float waitBeforeStarting)
 {
     if (isFlashing)
     {
         return;
     }
     GameObjectOperations.EnableDisableGameObjects(enableAtStart, true);
     GameObjectOperations.EnableDisableGameObjects(disableAtStart, false);
     delay       = waitBeforeStarting;
     duration    = lastsFor;
     frequency   = rate;
     ActiveAtEnd = showAtEnd;
     isFlashing  = true;
     UpdateMaster.Register(this as IUpdateSlave);
 }
Exemplo n.º 8
0
    public void DoSelectAction()
    {
        GameObjectOperations.EnableDisableGameObjects(enableOnSelect, true);
        GameObjectOperations.EnableDisableGameObjects(disableOnSelect, false);

        if (linkToNextMenu == null)
        {
            return;
        }
        if (linkToNextMenu.driveByMaster == null)
        {
            return;
        }
        linkToNextMenu.driveByMaster.SetActiveMenu(linkToNextMenu);
    }
Exemplo n.º 9
0
 protected override void gameObjectOperations(Train train)
 {
     main = new GameObject(originalMain.name + "@" + train.name.Split('@')[1]);
     GameObjectOperations.To(main).SetPosition(originalMain);
     base.gameObjectOperations(train);
 }
Exemplo n.º 10
0
 private Train clone(Train train, string newName)
 {
     return(GameObjectOperations.To(train.gameObject).Clone(newName).SetTag(NETWORK_TRAIN_TAG).GameObject.GetComponent <Train>());
 }
Exemplo n.º 11
0
 private Camera clone(Camera camera)
 {
     return(GameObjectOperations.To(camera.gameObject).Clone(FREE_CAMERA_NAME).RemoveComponent <AudioListener>().GameObject.GetComponent <Camera>());
 }