コード例 #1
0
ファイル: UIProjector.cs プロジェクト: zunaalabaya/TAC-BOT
 protected virtual void OnDestroy()
 {
     CameraHook.RemovePreCullEventListener(new CameraHook.PreCullEvent(this.PreCull));
     if (!this.AutoDestroyUIObject)
     {
         return;
     }
     GameUtility.DestroyGameObject((Component)this.UIObject);
 }
コード例 #2
0
    /// <summary>
    /// Start is called before the first frame update
    /// </summary>
    void Start()
    {
        animator  = GetComponent <Animator>();
        camHook   = GetComponentInChildren <CameraHook>();
        collecter = GetComponent <ItemCollecter>();

        EventManager.carEnter += OnCarEnter;

        canToggleInv = true;
    }
コード例 #3
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            if (mode != LoadMode.NewGame && mode != LoadMode.LoadGame)
            {
                return;
            }

            var cameraController = GameObject.FindObjectOfType <CameraController>();

            hook = cameraController.gameObject.AddComponent <CameraHook>();
        }
コード例 #4
0
 public static void AddPreCullEventListener(CameraHook.PreCullEvent e)
 {
     if (e == null)
     {
         return;
     }
     if (Application.get_isPlaying())
     {
         CameraHook.Inject();
     }
     CameraHook.mPreCullEventListeners += e;
 }
コード例 #5
0
 private void OnPreCull()
 {
     if (Application.get_isPlaying())
     {
         M0 component = ((Component)this).GetComponent <Camera>();
         ((Camera)component).set_cullingMask(((Camera)component).get_cullingMask() & ~(1 << GameUtility.LayerHidden));
     }
     if (CameraHook.mPreCullEventListeners == null)
     {
         return;
     }
     CameraHook.mPreCullEventListeners((Camera)((Component)this).GetComponent <Camera>());
 }
コード例 #6
0
ファイル: RenderPipeline.cs プロジェクト: zunaalabaya/TAC-BOT
 private void Start()
 {
     int[] values = (int[])Enum.GetValues(typeof(RenderTextureFormat));
     if (GameUtility.IsDebugBuild)
     {
         string str = string.Empty;
         for (int index = 0; index < values.Length; ++index)
         {
             if (SystemInfo.SupportsRenderTextureFormat((RenderTextureFormat)index))
             {
                 str = str + ((Enum)(object)(RenderTextureFormat)index).ToString() + " ";
             }
         }
         Debug.Log((object)("Supported RenderTexture Formats: " + str));
     }
     CameraHook.Inject();
 }
コード例 #7
0
    // Update is called once per frame
    void Update()
    {
        Transform  hook = target.transform.Find("CamHook");
        CameraHook h    = hook.gameObject.GetComponent <CameraHook>();
        float      dist = (hook.position - transform.position).magnitude;

        if (h.follow && dist > 0f)
        {
            Vector3 pos = Vector3.Lerp(transform.position, hook.position, Time.deltaTime);
            transform.position = pos;
        }
        else
        {
            h.follow = false;
        }

        transform.LookAt(target.transform.position + (Vector3.up * 1.5f));
    }
コード例 #8
0
    public void Awake()
    {
        instance = this;

        config = Configuration.Deserialize(configPath);
        if (config == null)
        {
            config = new Configuration();
        }

        currentSSAAFactor = userSSAAFactor = config.ssaaFactor;
        SaveConfig();

        cameraController = FindObjectOfType <CameraController>();

        bgTexture = new Texture2D(1, 1);
        bgTexture.SetPixel(0, 0, Color.grey);
        bgTexture.Apply();
    }
コード例 #9
0
ファイル: UIProjector.cs プロジェクト: zunaalabaya/TAC-BOT
 protected virtual void Start()
 {
     if (Object.op_Equality((Object)this.UIObject, (Object)null) && !string.IsNullOrEmpty(this.UIObjectID))
     {
         GameObject gameObject = GameObjectID.FindGameObject(this.UIObjectID);
         if (Object.op_Inequality((Object)gameObject, (Object)null))
         {
             this.UIObject = (RectTransform)gameObject.GetComponent <RectTransform>();
         }
     }
     if (Object.op_Equality((Object)this.mCanvas, (Object)null) && Object.op_Inequality((Object)this.UIObject, (Object)null))
     {
         this.mCanvas = (Canvas)((Component)this.UIObject).GetComponentInParent <Canvas>();
     }
     if (Object.op_Inequality((Object)this.mCanvas, (Object)null) && Object.op_Equality((Object)this.UIObject, (Object)null))
     {
         this.UIObject = new GameObject(((Object)((Component)this).get_gameObject()).get_name(), new System.Type[1]
         {
             typeof(RectTransform)
         }).get_transform() as RectTransform;
         ((Transform)this.UIObject).SetParent(((Component)this.mCanvas).get_transform(), false);
     }
     CameraHook.AddPreCullEventListener(new CameraHook.PreCullEvent(this.PreCull));
 }
コード例 #10
0
 private void OnDisable()
 {
     CameraHook.RemovePreCullEventListener(new CameraHook.PreCullEvent(this.PreCull));
 }
コード例 #11
0
 private void OnEnable()
 {
     CameraHook.AddPreCullEventListener(new CameraHook.PreCullEvent(this.PreCull));
 }