private void RecursivelyAddCount(AutoFaderExecution afe, int calculated)
    {
        afe.counter = 0;
        if (afe.countForNextAction != 0)
        {
            afe.countForNextAction += 200;
        }
        afe.countForNextAction += calculated;
        afe.FaderState          = FaderState.FadingIn;

        if (afe.Controller.Parent != null)
        {
            RecursivelyAddCount(afe.Controller.Parent.Execution, calculated);
        }
    }
Exemplo n.º 2
0
 public void MakeKids()
 {
     for (int i = 0; i < this.transform.childCount; i++)
     {
         GameObject child = this.transform.GetChild(i).gameObject;
         this.enabled = false;
         AutoFaderController afd = child.AddComponent <AutoFaderController>();
         AutoFaderExecution  afe = child.AddComponent <AutoFaderExecution>();
         afd.Execution  = afe;
         afd.Parent     = this;
         afd.Parent     = this;
         afd.Parent     = this;
         afe.Controller = afd;
         afd.MakeKids();
         afe.Initialize();
         afd.enabled = false;
         afe.enabled = false;
     }
 }
    // Use this for initialization
    void Awake()
    {
        Instance = this;
        foreach (Image image in GetComponentsInChildren <Image>())
        {
            image.color -= new Color(0, 0, 0, 1);
        }
        foreach (Text text in GetComponentsInChildren <Text>())
        {
            text.color -= new Color(0, 0, 0, 1);
        }
        foreach (AudioSource ac in GetComponentsInChildren <AudioSource>())
        {
            ac.volume = 0;
        }
        FirstController = this.gameObject.AddComponent <AutoFaderController>();
        AutoFaderExecution afe = this.gameObject.AddComponent <AutoFaderExecution>();

        FirstController.Execution = afe;

        afe.Controller = FirstController;
        FirstController.MakeKids();
        FirstController.enabled = false;
    }