少年修仙传客户端基础资源
lwb
2021-01-26 f10c768723fda22f62f26833bdaa672baa3dc322
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using UnityEngine;
 
namespace HotFix_Project
{
    class SomeMonoBehaviour : MonoBehaviour
    {
        float time;
        void Awake()
        {
            Debug.Log("!! SomeMonoBehaviour.Awake");
        }
 
        void Start()
        {
            Debug.Log("!! SomeMonoBehaviour.Start");
        }
 
        void Update()
        {
            if(Time.time - time > 1)
            {
                Debug.Log("!! SomeMonoBehaviour.Update, t=" + Time.time);
                time = Time.time;
            }
        }
 
        public void Test()
        {
            Debug.Log("SomeMonoBehaviour");
        }
    }
 
    class SomeMonoBehaviour2 : MonoBehaviour
    {
        public GameObject TargetGO;
        public Texture2D Texture;
        public void Test2()
        {
            Debug.Log("!!! SomeMonoBehaviour2.Test2");
        }
    }
 
    public class TestMonoBehaviour
    {
        public static void RunTest(GameObject go)
        {
            go.AddComponent<SomeMonoBehaviour>();
        }
 
        public static void RunTest2(GameObject go)
        {
            go.AddComponent<SomeMonoBehaviour2>();
            var mb = go.GetComponent<SomeMonoBehaviour2>();
            Debug.Log("!!!TestMonoBehaviour.RunTest2 mb= " + mb);
            mb.Test2();
        }
    }
}