Skip to content

Commit a6e9b49

Browse files
committed
update
update
1 parent 790286b commit a6e9b49

File tree

93 files changed

+253
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+253
-8
lines changed

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/1.Use DeltaTime/Scripts.meta renamed to Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.1 About GetComponent.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//AboutGetComponent
2+
3+
using UnityEngine;
4+
using System.Collections;
5+
6+
public class AboutGetComponent : MonoBehaviour
7+
{
8+
//--------------------------------变量定义部分---------------------------------
9+
private Transform ThisTransform = null;
10+
public float MoveSpeed = 5.0f;
11+
12+
//-----------------------------------------【Start()函数】---------------------------------------------
13+
// 说明:此函数仅在Update函数第一次被调用前被调用,常用于进行数据的初始化
14+
//--------------------------------------------------------------------------------------------------------
15+
void Start()
16+
{
17+
//初始化reference
18+
ThisTransform = GetComponent<Transform>();
19+
}
20+
21+
//-----------------------------------------【Update()函数】----------------------------------------
22+
// 说明:此函数在每一帧中都会被调用
23+
//------------------------------------------------------------------------------------------------------
24+
void Update()
25+
{
26+
//更新物体的位置
27+
if (ThisTransform != null)
28+
{
29+
ThisTransform.localPosition += Time.deltaTime * MoveSpeed * ThisTransform.forward;
30+
}
31+
}
32+
33+
}

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.1 About GetComponent/AboutGetComponent.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.1 About GetComponent/AboutGetComponent.unity.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.2 Getting Multiple Components.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.2 Getting Multiple Components/Getting Multiple Components.unity.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//Gettingmultiplecomponents
2+
3+
using UnityEngine;
4+
using System.Collections;
5+
6+
public class GettingMultipleComponents : MonoBehaviour
7+
{
8+
//--------------------------------变量定义部分---------------------------------
9+
//所有组件的引用集合数组
10+
private Component[ ] AllComponents = null;
11+
12+
13+
//-----------------------------------------【Start()函数】---------------------------------------------
14+
// 说明:此函数仅在Update函数第一次被调用前被调用,常用于进行数据的初始化
15+
//--------------------------------------------------------------------------------------------------------
16+
void Start ( )
17+
{
18+
//获取所有的组件的集合
19+
AllComponents = GetComponents<Component>();
20+
21+
foreach(Component component in AllComponents)
22+
{
23+
//输出到控制台
24+
Debug.Log("该物体具有组件"+component.ToString());
25+
}
26+
}
27+
28+
//-----------------------------------------【Update()函数】----------------------------------------
29+
// 说明:此函数在每一帧中都会被调用
30+
//------------------------------------------------------------------------------------------------------
31+
void Update ( )
32+
{
33+
34+
}
35+
36+
}

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.2 Getting Multiple Components/GettingMultipleComponents.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.3 Use Invoke.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//UseInvoke
2+
3+
using UnityEngine;
4+
using System.Collections;
5+
6+
public class UseInvoke : MonoBehaviour
7+
{
8+
//--------------------------------变量定义部分---------------------------------
9+
10+
11+
//-----------------------------------------【Start()函数】---------------------------------------------
12+
// 说明:此函数仅在Update函数第一次被调用前被调用,常用于进行数据的初始化
13+
//--------------------------------------------------------------------------------------------------------
14+
void Start ( )
15+
{
16+
//经过1秒之后再调用指定函数
17+
Invoke("CallOfDuty", 1.0f);
18+
}
19+
20+
//-----------------------------------------【Update()函数】----------------------------------------
21+
// 说明:此函数在每一帧中都会被调用
22+
//------------------------------------------------------------------------------------------------------
23+
void Update ( )
24+
{
25+
26+
}
27+
void CallOfDuty()
28+
{
29+
Debug.Log("hi,我被调用了~!");
30+
}
31+
}

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.3 Use Invoke/UseInvoke.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.3 Use Invoke/UseInvoke.unity.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.4 Finding GameObjects.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//FindingGameObjects
2+
3+
using UnityEngine;
4+
using System.Collections;
5+
6+
public class FindingGameObjects : MonoBehaviour
7+
{
8+
//--------------------------------变量定义部分---------------------------------
9+
//要找到的物体的Tag名称
10+
public string TagName = "Finish";
11+
//数组
12+
public GameObject[] FoundObjects;
13+
14+
//-----------------------------------------【Start()函数】---------------------------------------------
15+
// 说明:此函数仅在Update函数第一次被调用前被调用,常用于进行数据的初始化
16+
//--------------------------------------------------------------------------------------------------------
17+
void Start ( )
18+
{
19+
FoundObjects = GameObject.FindGameObjectsWithTag(TagName);
20+
foreach(GameObject go in FoundObjects)
21+
{
22+
Debug.Log("报告,找到一个Tag为"+TagName+"的物体,名为"+go.name);
23+
}
24+
}
25+
26+
//-----------------------------------------【Update()函数】----------------------------------------
27+
// 说明:此函数在每一帧中都会被调用
28+
//------------------------------------------------------------------------------------------------------
29+
void Update ( )
30+
{
31+
32+
}
33+
34+
}

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.4 Finding GameObjects/FindingGameObjects.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mastering Unity Scripting/Assets/Part 2.Play With GameObject/2.4 Finding GameObjects/FindingGameObjects.unity.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3.84 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Mastering Unity Scripting/Library/shadercompiler-32bit-1.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Base path: D:/Program Files/Unity-5.2.1/Editor/Data
2-
Pipe name: \\.\pipe\UnityShaderCompiler-32bit-1-15628
2+
Pipe name: \\.\pipe\UnityShaderCompiler-32bit-1-19200
33
Cmd: getPlatforms
44
Unhandled exception: Readfile from pipe failed. GLE=管道已结束。
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Base path: D:/Program Files/Unity-5.2.1/Editor/Data
2-
Pipe name: \\.\pipe\UnityShaderCompiler-64bit-1-15628
2+
Pipe name: \\.\pipe\UnityShaderCompiler-64bit-1-19200
33
Cmd: getPlatforms

Mastering Unity Scripting/Mastering Unity Scripting.CSharp.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@
6969
</Reference>
7070
</ItemGroup>
7171
<ItemGroup>
72-
<Compile Include="Assets\Part 1.C# Game scripting refesher\1.About polymorphism\Scripts\MyCharacter.cs" />
73-
<Compile Include="Assets\Part 1.C# Game scripting refesher\1.About polymorphism\Scripts\Tavern.cs" />
74-
<Compile Include="Assets\Part 1.C# Game scripting refesher\2.About properties\Scripts\Database.cs" />
75-
<Compile Include="Assets\Part 2.Play With GameObject\1.Use DeltaTime\Scripts\UseDeltaTime.cs" />
72+
<Compile Include="Assets\Part 1.C# Game scripting refesher\1.1 About polymorphism\Scripts\MyCharacter.cs" />
73+
<Compile Include="Assets\Part 1.C# Game scripting refesher\1.1 About polymorphism\Scripts\Tavern.cs" />
74+
<Compile Include="Assets\Part 1.C# Game scripting refesher\1.2 About properties\Scripts\Database.cs" />
75+
<Compile Include="Assets\Part 2.Play With GameObject\2.1 About GetComponent\AboutGetComponent.cs" />
76+
<Compile Include="Assets\Part 2.Play With GameObject\2.2 Getting Multiple Components\GettingMultipleComponents.cs" />
77+
<Compile Include="Assets\Part 2.Play With GameObject\2.3 Use Invoke\UseInvoke.cs" />
78+
<Compile Include="Assets\Part 2.Play With GameObject\2.4 Finding GameObjects\FindingGameObjects.cs" />
79+
<Compile Include="Assets\Part 2.Play With GameObject\x.Use DeltaTime\UseDeltaTime.cs" />
7680
</ItemGroup>
7781
<Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2013\UnityVS.CSharp.targets" />
7882
</Project>
Binary file not shown.

0 commit comments

Comments
 (0)