SHARE
TWEET

Untitled

a guest Jul 17th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3. using Zenject;
  4. using System.Collections.Generic;
  5.  
  6. public class MainRightPanel : MonoBehaviour
  7. {
  8.     //[Inject]
  9.     //private TractorSignals.TurnPaint.Trigger _turnPaint;
  10.     public bool Paint = false;
  11.  
  12.     public List<LineDrawController> controllers;
  13.     public GameObject togglesWindow;
  14.  
  15.     public PerecritiePanel overlapPanel;
  16.  
  17.     public static MainRightPanel Instance;
  18.  
  19.     void Awake()
  20.     {
  21.         try
  22.         {
  23.             Instance = this;
  24.             overlapPanel.Setup(SaveController.Instance.data.overlapM, SaveController.Instance.data.zOffset, SaveController.Instance.data.zSMOffset);
  25.         }
  26.         catch { }
  27.     }
  28.  
  29.     public void UI_OnTurnPaint(bool value)
  30.     {
  31.         if (CheckWorkType.Instance.typeId != 5)
  32.         {
  33.             /*if (_turnPaint != null)
  34.             {
  35.                 _turnPaint.Fire(value);
  36.             }*/
  37.             foreach (LineDrawController controller in controllers)
  38.             {
  39.                 controller.OnTurnDraw(value);
  40.             }
  41.             Paint = value;
  42.             togglesWindow.SetActive(value);
  43.         }
  44.         else
  45.         {
  46.             StopAllCoroutines();
  47.             if (value)
  48.             {
  49.                 StartCoroutine(Bar.Instance.StartPainting());
  50.             }
  51.             else
  52.             {
  53.                 StartCoroutine(Bar.Instance.StopPainting());
  54.             }
  55.         }
  56.     }
  57.  
  58.     public void Combine_OnTurnPaint(bool value)
  59.     {
  60.         /*if (_turnPaint != null)
  61.             _turnPaint.Fire(value);
  62.         */
  63.         foreach (LineDrawController controller in controllers)
  64.         {
  65.             controller.OnTurnDraw(value);
  66.         }
  67.         Paint = value;
  68.         togglesWindow.SetActive(value);
  69.     }
  70.  
  71.     public void EndDraw()
  72.     {
  73.         foreach (LineDrawController controller in controllers)
  74.         {
  75.                 controller.OnTurnDraw(false);
  76.         }
  77.     }
  78.  
  79.     public void ContinueDraw()
  80.     {
  81.         foreach (LineDrawController controller in controllers)
  82.         {
  83.             controller.OnTurnDraw(Paint);
  84.         }
  85.     }
  86. }
RAW Paste Data
Top