forked from u3dkbe/kbengine_unity3d_warring
-
Notifications
You must be signed in to change notification settings - Fork 324
Expand file tree
/
Copy pathSceneObject.cs
More file actions
151 lines (121 loc) · 5.52 KB
/
SceneObject.cs
File metadata and controls
151 lines (121 loc) · 5.52 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using UnityEngine;
using KBEngine;
using System.Collections;
using System;
using System.Xml;
using System.Collections.Generic;
public class SceneObject : AssetAsyncLoadObjectCB
{
public bool visble = true;
public bool isWatcherLoad = false;
private Vector3 _position = Vector3.zero;
private Vector3 _eulerAngles = Vector3.zero;
private Vector3 _scale = Vector3.zero;
private float _speed = 0f;
public SceneObject()
{
}
public string name {
get;
set;
}
public string idkey {
get;
set;
}
public Asset asset {
get;
set;
}
public Vector3 position {
get
{
return _position;
}
set
{
_position = value;
//if(gameObject != null)
if (!System.Object.ReferenceEquals(gameObject, null))
{
gameObject.transform.position = _position;
}
}
}
public Vector3 eulerAngles {
get
{
return _eulerAngles;
}
set
{
_eulerAngles = value;
//if(gameObject != null)
if (!System.Object.ReferenceEquals(gameObject, null))
{
gameObject.transform.eulerAngles = _eulerAngles;
}
}
}
public Quaternion rotation {
get
{
return Quaternion.Euler(_eulerAngles);
}
set
{
eulerAngles = value.eulerAngles;
}
}
public Vector3 scale {
get
{
return _scale;
}
set
{
_scale = value;
//if(gameObject != null)
if (!System.Object.ReferenceEquals(gameObject, null))
{
gameObject.transform.localScale = _scale;
}
}
}
public float speed {
get
{
return _speed;
}
set
{
_speed = value;
}
}
public UnityEngine.GameObject gameObject {
get;
set;
}
public virtual void Instantiate()
{
//if(gameObject != null)
if (!System.Object.ReferenceEquals(gameObject, null))
{
return;
}
asset.Instantiate(this, name, _position, _eulerAngles, _scale);
}
public override void onAssetAsyncLoadObjectCB(string name, UnityEngine.Object obj, Asset asset)
{
gameObject = obj as UnityEngine.GameObject;
//if(gameObject != null)
if (!System.Object.ReferenceEquals(gameObject, null))
{
Common.DEBUG_MSG("SceneObject::onAssetAsyncLoadObjectCB: name(" + name +
") is successfully! position(" + _position.x + "," + _position.y + "," + _position.z + "), scale(" + _scale.x + "," + _scale.y + "," + _scale.z + ")");
}
}
public virtual void onLoadProgress(float value)
{
}
}