summaryrefslogtreecommitdiff
path: root/AlienSurvival/Assets/Scripts/Test
diff options
context:
space:
mode:
Diffstat (limited to 'AlienSurvival/Assets/Scripts/Test')
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestAstro.cs77
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestAstro.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestB2.cs79
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestB2.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs51
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs79
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBomb.cs67
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBomb.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs107
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBucket.cs35
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestBucket.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs23
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCannon.cs44
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCannon.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs40
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs40
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs23
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs132
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestGrenade.cs107
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestGrenade.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestLauncher.cs67
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestLauncher.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs43
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMirror.cs30
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMirror.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs45
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs314
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs51
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs67
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs13
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestRobot1.cs33
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestRobot1.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs46
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSeperator.cs41
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSeperator.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSingleton.cs20
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSingleton.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSorting.cs18
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSorting.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs9
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs18
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs70
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs78
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs.meta11
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs145
-rw-r--r--AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs.meta11
66 files changed, 0 insertions, 2386 deletions
diff --git a/AlienSurvival/Assets/Scripts/Test/TestAstro.cs b/AlienSurvival/Assets/Scripts/Test/TestAstro.cs
deleted file mode 100644
index 3b4df18..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestAstro.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestAstro : MonoBehaviour
-{
- [SerializeField] private Transform m_Camera;
-
- [SerializeField] private float m_Speed;
-
- [SerializeField] private SpriteRenderer m_Shadow;
-
- private SpriteRenderer m_SpriteRenderer;
- private TestFakeHeight m_FakeHeight;
-
-
-
- void Start()
- {
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
- m_FakeHeight = GetComponent<TestFakeHeight>();
- }
-
- void Update()
- {
- float x = Input.GetAxisRaw("Horizontal");
- float y = Input.GetAxisRaw("Vertical");
-
- Vector3 targetZoom = Vector3.one;
-
- if(x != 0 || y != 0)
- {
- targetZoom = new Vector3(1f, 1f, 1);
-
- Vector2 direction = new Vector2(x, y).normalized;
-
- Vector3 position = transform.position;
- position.x += direction.x * m_Speed * Time.deltaTime;
- position.y += direction.y * m_Speed * Time.deltaTime;
-
- transform.position = position;
-
- if (x > 0)
- {
- m_SpriteRenderer.flipX = false;
- m_Shadow.flipX = false;
- }
- else if (x < 0)
- {
- m_SpriteRenderer.flipX = true;
- m_Shadow.flipX = true;
- }
- }
- else
- {
- targetZoom = new Vector3(0.5f, 0.5f, 1);
- }
-
- Vector3 zoom = m_Camera.localScale;
- m_Camera.localScale = Vector3.Lerp(zoom, targetZoom, Time.deltaTime);
-
- CameraFollow();
- }
-
- void CameraFollow()
- {
- Vector3 pos = m_Camera.position;
- pos.x = m_FakeHeight.x;
- pos.y = m_FakeHeight.y;
-
- if(Vector3.Distance(pos, m_Camera.position) > 0.1f)
- {
- m_Camera.position = Vector3.Lerp(m_Camera.position, pos, 3 * Time.deltaTime);
- }
-
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestAstro.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestAstro.cs.meta
deleted file mode 100644
index a96a9b4..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestAstro.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: dc04e45eaa06e994a806119e4fd0701c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestB2.cs b/AlienSurvival/Assets/Scripts/Test/TestB2.cs
deleted file mode 100644
index 532c254..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestB2.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestB2 : MonoBehaviour
-{
- [SerializeField] private TestBomb m_Bomb;
- [SerializeField] private float m_Speed;
-
- private Vector3 m_From;
- private Vector3 m_To;
-
- private Coroutine m_CoBomb;
-
- Vector3 direction
- {
- get
- {
- return (m_To - m_From).normalized;
- }
- }
-
- /// <summary>
- /// from to 在3d空间
- /// </summary>
- /// <param name="from"></param>
- /// <param name="to"></param>
- public void Set(Vector3 from, Vector3 to, float speed, float lifeTime)
- {
- m_From = from;
- m_To = to;
- m_Speed = speed;
-
- transform.position = from;
-
- this.gameObject.SetActive(true);
-
- m_CoBomb = StartCoroutine(coBomb(0.1f));
-
- Invoke("DestroySelf", lifeTime);
- }
-
- void DestroySelf()
- {
- if (m_CoBomb != null)
- {
- StopCoroutine(m_CoBomb);
- m_CoBomb = null;
- }
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
- }
-
- private void Update()
- {
- Vector3 pos = transform.position;
- pos += direction * m_Speed * Time.deltaTime;
-
- transform.position = pos;
- }
-
- IEnumerator coBomb(float interval)
- {
- while (true)
- {
- Vector3 pos = transform.position;
- for(int i = 0; i < 1; ++i)
- {
- TestBomb grenade = Instantiate<TestBomb>(m_Bomb);
- Vector3 position = new Vector3(pos.x + Random.Range(-3, 3), pos.y + Random.Range(-5f, 5f), 7f);
- grenade.Set(position, new Vector3(0, 0, -1f), Random.Range(8f, 10f));
- grenade.gameObject.SetActive(true);
- }
-
- yield return new WaitForSeconds(interval);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestB2.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestB2.cs.meta
deleted file mode 100644
index 1e507c7..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestB2.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: a908894d8ef917543ad67959640ec30b
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs b/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs
deleted file mode 100644
index 17d0005..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestBeamBullet : MonoBehaviour
-{
- public Vector3 direction;
- public float speed;
-
- // Start is called before the first frame update
- void Start()
- {
- Invoke("Dead", 3);
- }
-
- void Dead()
- {
- if (this.gameObject)
- {
- GameObject.Destroy(this.gameObject);
- }
- }
-
- // Update is called once per frame
- void Update()
- {
- Vector3 position = transform.position;
- position += direction * speed * Time.deltaTime;
- transform.position = position;
- }
-
- private void OnTriggerEnter2D(Collider2D collision)
- {
- GameObject go = collision.gameObject;
-
- if (!go.CompareTag("enemy"))
- {
- return;
- }
-
- GameObject.Destroy( collision.gameObject);
-
- //this.gameObject.SetActive(false);
-
- if (this.gameObject)
- {
- GameObject.Destroy(this.gameObject);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs.meta
deleted file mode 100644
index b1551a7..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBeamBullet.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: ca62ef044d3b4104eac135eea37e0c03
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs b/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs
deleted file mode 100644
index 69225b6..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestBeamGun : MonoBehaviour
-{
- public TestBeamBullet bullet;
-
- public Transform start;
-
- public float speed = 1;
-
- SpriteRenderer sprite;
-
- // Start is called before the first frame update
- void Start()
- {
- sprite = GetComponent<SpriteRenderer>();
-
- // StartCoroutine(coFire());
- }
-
- // Update is called once per frame
- void Update()
- {
-
- Vector3 screenPos = Input.mousePosition;
-
- Vector2 target = Camera.main.ScreenToWorldPoint(screenPos);
-
- Vector2 dir = Vector2.ClampMagnitude(target - (Vector2)transform.position, 1);
- Vector3 move = dir * speed * Time.deltaTime;
-
- float x = move.x;
- if (x > 0)
- {
- sprite.flipY = false;
- }
- else if (x < 0)
- {
- sprite.flipY = true;
- }
-
- transform.rotation = Quaternion.Euler(0, 0, Mathf.Rad2Deg * Mathf.Atan2(dir.y, dir.x));
-
- Shot();
- }
-
- void Shot()
- {
- if (Input.GetButtonDown("Fire1"))
- {
- //Debug.Log("Shoot");
-
- TestBeamBullet b = TestBeamBullet.Instantiate(bullet);
- b.gameObject.SetActive(true);
-
- b.transform.position = start.position;
-
- b.direction = transform.right;
- }
- }
-
- IEnumerator coFire()
- {
- while (true)
- {
- TestBeamBullet b = TestBeamBullet.Instantiate(bullet);
- b.gameObject.SetActive(true);
-
- b.transform.position = start.position;
-
- b.direction = transform.right;
-
- yield return new WaitForSeconds(0.5f);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs.meta
deleted file mode 100644
index cfeb8f2..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBeamGun.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 058a2b89691b2f94d912ff341719edd9
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBomb.cs b/AlienSurvival/Assets/Scripts/Test/TestBomb.cs
deleted file mode 100644
index 77933f4..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBomb.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestBomb : MonoBehaviour
-{
-
- [SerializeField] private float m_GravityScale = 1f;
-
- [SerializeField] private GameObject m_ExplosionEffect;
-
- private TopDownTransform m_Coords;
-
- private Vector3 GRAVITY = new Vector3(0, 0, -9.8f);
-
- private Vector3 m_Velocity; // x, y, fakeHeight
-
- /// <summary>
- /// 设置初始参数,都在fake空间下
- /// </summary>
- /// <param name="initPosition"></param>
- /// <param name="initDirection"></param>
- /// <param name="initSpeed"></param>
- public void Set(Vector3 initPosition, Vector3 initDirection, float initSpeed)
- {
- m_Coords = GetComponent<TopDownTransform>();
- m_Coords.position = initPosition;
-
- m_Velocity = initDirection * initSpeed;
- }
-
- private void Update()
- {
- Vector3 move = m_Velocity * Time.deltaTime;
-
- if (m_Velocity.magnitude > 0 && m_Coords.z + move.z >= 0)
- {
- m_Coords.x += move.x;
- m_Coords.y += move.y;
- m_Coords.z += move.z;
- m_Velocity += GRAVITY * Time.deltaTime;
-
- //transform.rotation *= Quaternion.Euler(0, 0, 20 * m_Velocity.magnitude * Time.deltaTime);
- }
- else
- {
- m_Velocity = Vector3.zero;
-
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
- PlayExplosion();
- }
- }
-
- private void PlayExplosion()
- {
- GameObject exp = Instantiate<GameObject>(m_ExplosionEffect);
-
- TopDownTransform coord = exp.GetComponent<TopDownTransform>();
- coord.position = m_Coords.position;
-
- exp.GetComponent<TopDownSorting>().Sorting();
-
- exp.SetActive(true);
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBomb.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestBomb.cs.meta
deleted file mode 100644
index 06d61d2..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBomb.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c0bb267c6728269489ed4f713b032db5
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs b/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs
deleted file mode 100644
index 4399886..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestBrokenPiece : MonoBehaviour
-{
- [SerializeField] private List<Sprite> m_Pieces;
-
- private TestFakeHeight m_Coord;
-
- private Vector3 m_Velocity;
-
- private Vector3 m_Gravity = new Vector3(0, 0, -9.8f);
-
- private float m_Damp = 0.5f;
-
- private SpriteRenderer m_SpriteRenderer;
-
- enum State
- {
- Avlie ,
- Dead ,
- }
-
- State m_State;
-
- private void Awake()
- {
- m_Coord = GetComponent<TestFakeHeight>();
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
- }
-
- public void Set(Vector3 position, Vector3 dir, float speed, int index)
- {
- m_Coord = GetComponent<TestFakeHeight>();
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
-
- m_Coord.x = position.x;
- m_Coord.y = position.y;
- m_Coord.height = position.z;
-
- m_Velocity = dir * speed;
-
- m_SpriteRenderer.sprite = m_Pieces[index % m_Pieces.Count];
-
- m_State = State.Avlie;
- }
-
- private void Update()
- {
- if(m_State == State.Avlie)
- {
- m_Velocity += m_Gravity * Time.deltaTime;
-
- m_Coord.x += m_Velocity.x * Time.deltaTime;
- m_Coord.y += m_Velocity.y * Time.deltaTime;
- m_Coord.height += m_Velocity.z * Time.deltaTime;
-
- if (m_Coord.height < 0)
- {
- m_Coord.height = 0;
-
- // bounce
- m_Velocity.x = m_Velocity.x * m_Damp;
- m_Velocity.y = m_Velocity.y * m_Damp;
- m_Velocity.z = -m_Velocity.z * m_Damp;
-
- if (m_Velocity.magnitude < 0.1f)
- {
- m_State = State.Dead;
- StartCoroutine(coDead(Random.Range(1f, 3f)));
- }
- }
- }
- else if(m_State == State.Dead)
- {
- }
- }
-
- IEnumerator coDead( float time)
- {
- Color c = m_SpriteRenderer.color;
-
- float t = 0;
- while (true)
- {
- t += Time.deltaTime;
-
- c.a = (time - t) / time;
-
- m_SpriteRenderer.color = c;
-
- if(t > time)
- {
- break;
- }
-
- yield return null;
- }
-
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
-
- yield break;
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs.meta
deleted file mode 100644
index 73da026..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBrokenPiece.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c7182d8bf5ade5c47a2a98ae355119f3
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBucket.cs b/AlienSurvival/Assets/Scripts/Test/TestBucket.cs
deleted file mode 100644
index c3e28f4..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBucket.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestBucket : MonoBehaviour
-{
- [SerializeField] private TestBrokenPiece m_Piece;
-
- private TopDownTransform m_Coord;
-
- private void Awake()
- {
- m_Coord = GetComponent<TopDownTransform>();
- }
-
- public void Broken()
- {
- for(int i = 0; i < 10; ++i)
- {
- TestBrokenPiece piece = Instantiate<TestBrokenPiece>(m_Piece);
- piece.Set(m_Coord.position + new Vector3(0,0,1f),
- new Vector3(Random.Range(-1f,1f), Random.Range(-1f, 1f), Random.Range(0.5f, 2f)).normalized, Random.Range(1f, 3f)
- , i);
- }
-
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestBucket.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestBucket.cs.meta
deleted file mode 100644
index 3d9e92b..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestBucket.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: b3861aac24d796348936aa3f51d27a97
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs b/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs
deleted file mode 100644
index 585f2c3..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-[RequireComponent(typeof(Camera))]
-public class TestCameraSortByY : MonoBehaviour
-{
- private Camera camera;
-
- // Start is called before the first frame update
- void Start()
- {
- camera = GetComponent<Camera>();
- camera.transparencySortMode = TransparencySortMode.CustomAxis;
- camera.transparencySortAxis = Vector3.up;
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs.meta
deleted file mode 100644
index 210a02e..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCameraSortByY.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: b692e7619b71ada41b02f616b9a6134d
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCannon.cs b/AlienSurvival/Assets/Scripts/Test/TestCannon.cs
deleted file mode 100644
index 22b168b..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCannon.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestCannon : MonoBehaviour
-{
- public TestBeamBullet bullet;
-
- public Transform start;
-
- public float speed = 1;
-
- SpriteRenderer sprite;
-
- // Start is called before the first frame update
- void Start()
- {
- sprite = GetComponent<SpriteRenderer>();
-
- StartCoroutine(coFire(1f));
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-
- IEnumerator coFire(float interval)
- {
- while (true)
- {
- TestBeamBullet b = TestBeamBullet.Instantiate(bullet);
- b.gameObject.SetActive(true);
-
- b.transform.position = start.position;
-
- b.direction = -transform.right;
-
- yield return new WaitForSeconds(interval);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCannon.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestCannon.cs.meta
deleted file mode 100644
index 52c902c..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCannon.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 14e80cec1a94a5449b2081ac81bea639
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs b/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs
deleted file mode 100644
index 8911ea9..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestCharacterMovement : MonoBehaviour
-{
- public SpriteRenderer sprite;
-
- public float speed;
-
- // Start is called before the first frame update
- void Start()
- {
- sprite = GetComponent<SpriteRenderer>();
-
- }
-
- // Update is called once per frame
- void Update()
- {
- float x = Input.GetAxis("Horizontal");
- float y = Input.GetAxis("Vertical");
-
- Vector3 position = transform.position;
- position.x += x * speed * Time.deltaTime;
- position.y += y * speed * Time.deltaTime;
-
- transform.position = position;
-
- if (x > 0)
- {
- sprite.flipX = false;
- }
- else if(x < 0)
- {
- sprite.flipX = true;
- }
-
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs.meta
deleted file mode 100644
index 606b4cc..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestCharacterMovement.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: a2fd7e5c6f466b7448001599a97c5b58
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs b/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs
deleted file mode 100644
index e0457cd..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestDestroySelf : MonoBehaviour
-{
- public float lifeTime;
-
- public AnimationCurve alphaCurve;
-
- private float time;
-
- private SpriteRenderer sr;
-
- void Start()
- {
- Invoke("DestroySelf", lifeTime);
- time = 0;
- sr = GetComponent<SpriteRenderer>();
- }
-
- void DestroySelf()
- {
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
- }
-
- void Update()
- {
- time += Time.deltaTime;
-
- if (sr)
- {
- Color c = sr.color;
- c.a = alphaCurve.Evaluate(time / lifeTime);
- sr.color = c;
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs.meta
deleted file mode 100644
index c1dc2b5..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestDestroySelf.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 6bde42b3ff5cbc44ca4e036544c3cde9
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs b/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs
deleted file mode 100644
index 57b777d..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestEnforceTransform0 : MonoBehaviour
-{
- void Update()
- {
-// transform.localToWorldMatrix = Matrix4x4.identity;
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs.meta
deleted file mode 100644
index 3371029..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestEnforceTransform0.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 666db70fcce7c7e4a94cc321eb68e307
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs b/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs
deleted file mode 100644
index 5d8f2c5..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestFakeCube : MonoBehaviour
-{
- public float z; // fake height
-
- // Start is called before the first frame update
- void Start()
- {
-
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-
-
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs.meta
deleted file mode 100644
index 83c3602..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestFakeCube.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 84033172d3ac67f4eb3eb8586b6ecb11
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs b/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs
deleted file mode 100644
index 4cc13d1..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-#if UNITY_EDITOR
-using UnityEditor;
-#endif
-
-//[ExecuteInEditMode]
-public class TestFakeHeight : MonoBehaviour
-{
- [SerializeField] private Transform m_Shadow;
- [SerializeField] private Vector3 m_Coord;
-
-
- public float height {
- get
- {
- return m_Height;
- }
- set
- {
- m_Height = value;
- }
- }
- [SerializeField] private float m_Height; // current fake height
-
- public float x
- {
- get
- {
- return transform.position.x;
- }
-
- set
- {
- Vector3 pos = transform.position;
- pos.x = value;
- transform.position = pos;
- }
- }
-
- public float y
- {
- get
- {
- return transform.position.y - m_Height;
- }
- set
- {
- Vector3 pos = transform.position;
- pos.y = value + m_Height;
- transform.position = pos;
- }
- }
-
- public Vector3 position
- {
- get
- {
- Vector3 pos = new Vector3(x, y, height);
- return pos;
- }
- set
- {
- height = value.z; // height先设置
- x = value.x;
- y = value.y;
- }
- }
-
- public Vector2 positionOnGround
- {
- get
- {
- Vector2 pos = new Vector2(x, y);
- return pos;
- }
- set
- {
- x = value.x;
- y = value.y;
- }
- }
-
- private SpriteRenderer m_SpriteRenderer;
-
- private void OnEnable()
- {
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
- }
-
- private void Start()
- {
- Project();
- }
-
- void Project()
- {
- Vector3 pos = transform.position;
- pos.y = y + height;
- transform.position = pos;
-
- if (m_Shadow != null)
- {
- m_Shadow.position = new Vector3(transform.position.x, transform.position.y - m_Height, transform.position.z);
- }
-
- // 根据y设置sortOrder
- m_SpriteRenderer.sortingOrder = (int)(-y * 100);
- }
-
- void Update()
- {
- Project();
- }
-
-#if UNITY_EDITOR
-
- private void OnDrawGizmos()
- {
- // dash line
- Vector3 start = transform.position;
- Vector3 end = start - new Vector3(0, m_Height, 0);
-
- Handles.DrawDottedLine(start, end, 1f);
- Handles.DrawWireCube(end, new Vector3(0.1f, 0.1f, 0f));
-
- }
-
-#endif
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs.meta
deleted file mode 100644
index a91173e..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestFakeHeight.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 780072e6ea35d1f4abd930754c5e9c9f
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs b/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs
deleted file mode 100644
index a1434d8..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestPseudoVec3
-{
- public float x;
- public float y;
- public float h;
- public TestPseudoVec3(float x, float y, float h)
- {
- this.x = x;
- this.y = y;
- this.h = h;
- }
-}
-
-public class TestGrenade : MonoBehaviour
-{
- public bool useGravity;
-
- public float gravity = -9.8f;
-
- public TestPseudoVec3 velocity;
- public TestPseudoVec3 pseudoPos;
-
- public Transform shadow;
-
- private bool m_IsGround
- {
- get
- {
- return pseudoPos.h <= 0;
- }
- }
-
- // Start is called before the first frame update
- void Start()
- {
- //Invoke("Dead", 3);
- }
-
- void Dead()
- {
- if (this.gameObject)
- {
- GameObject.Destroy(this.gameObject);
- }
- }
-
- // Update is called once per frame
- void Update()
- {
- if(useGravity && !m_IsGround)
- {
- velocity.h += gravity * Time.deltaTime;
- }
-
- pseudoPos.x += velocity.x * Time.deltaTime;
- pseudoPos.y += velocity.y * Time.deltaTime;
- pseudoPos.h += velocity.h * Time.deltaTime;
-
- if(m_IsGround)
- {
- velocity.h = -velocity.h;
- pseudoPos.h = 0;
- }
-
- Vector3 position = transform.position;
-
- position.x = pseudoPos.x;
- position.y = pseudoPos.y + pseudoPos.h;
-
- transform.position = position;
-
- if (shadow)
- {
- // shadow position
- shadow.rotation = Quaternion.identity;
- Vector3 shadowPos = Vector3.zero;
- shadowPos.x = pseudoPos.x;
- shadowPos.y = pseudoPos.y;
- shadowPos.z = 0;
- shadow.position = shadowPos;
- }
- }
-
- private void OnTriggerEnter2D(Collider2D collision)
- {
- //GameObject go = collision.gameObject;
-
- //if (!go.CompareTag("enemy"))
- //{
- // return;
- //}
-
- //GameObject.Destroy(collision.gameObject);
-
- ////this.gameObject.SetActive(false);
-
- //if (this.gameObject)
- //{
- // GameObject.Destroy(this.gameObject);
- //}
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs.meta
deleted file mode 100644
index f5d87e9..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestGrenade.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 76da92161ea22274996c5bc1d0bdea94
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs b/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs
deleted file mode 100644
index f053854..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestLauncher : MonoBehaviour
-{
- public TestGrenade bullet;
-
- public Transform shadow;
-
- public Transform start;
-
- public float speed = 1;
-
- SpriteRenderer sprite;
-
- // Start is called before the first frame update
- void Start()
- {
- sprite = GetComponent<SpriteRenderer>();
- }
-
- // Update is called once per frame
- void Update()
- {
-
- Vector3 screenPos = Input.mousePosition;
-
- Vector2 target = Camera.main.ScreenToWorldPoint(screenPos);
-
- Vector2 dir = Vector2.ClampMagnitude(target - (Vector2)transform.position, 1);
- Vector3 move = dir * speed * Time.deltaTime;
-
- float x = move.x;
- if (x > 0)
- {
- sprite.flipY = false;
- }
- else if (x < 0)
- {
- sprite.flipY = true;
- }
-
- transform.rotation = Quaternion.Euler(0, 0, Mathf.Rad2Deg * Mathf.Atan2(dir.y, dir.x));
-
- Shot();
- }
-
- void Shot()
- {
- if (Input.GetButtonDown("Fire1"))
- {
- //Debug.Log("Shoot");
-
- TestGrenade b = TestGrenade.Instantiate(bullet);
- b.gameObject.SetActive(true);
-
- b.transform.position = start.position;
-
- b.pseudoPos = new TestPseudoVec3(start.position.x, start.position.y, 0.1f);
-
- float speed = 5;
- b.velocity = new TestPseudoVec3(transform.right.x * speed, transform.right.y * speed, 3f);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs.meta
deleted file mode 100644
index 8688fc3..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestLauncher.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 45111da1fa00b2a4192afc01c5be0873
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs b/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs
deleted file mode 100644
index 239d8ed..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestMathHelper : MonoBehaviour
-{
-
- public static Vector2 Rotate(Vector2 v, float delta)
- {
- return new Vector2(
- v.x * Mathf.Cos(delta) - v.y * Mathf.Sin(delta),
- v.x * Mathf.Sin(delta) + v.y * Mathf.Cos(delta)
- );
- }
-
- /// <summary>
- /// 返回角度
- /// </summary>
- /// <param name="vector2"></param>
- /// <returns></returns>
- public static float Angle(Vector2 vector2)
- {
- return 360 - (Mathf.Atan2(vector2.y, vector2.x) * Mathf.Rad2Deg * Mathf.Sign(vector2.y));
- }
-
- public static int Check(bool condition)
- {
- return condition ? 1 : 0;
- }
-
- //public static float Angle(Vector2 vector2)
- //{
- // if (vector2.x < 0)
- // {
- // return 360 - (Mathf.Atan2(vector2.x, vector2.y) * Mathf.Rad2Deg * -1);
- // }
- // else
- // {
- // return Mathf.Atan2(vector2.x, vector2.y) * Mathf.Rad2Deg;
- // }
- //}
-
-} \ No newline at end of file
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs.meta
deleted file mode 100644
index 872d038..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMathHelper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c40b8edb8d6570e419f024263e4cc43a
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMirror.cs b/AlienSurvival/Assets/Scripts/Test/TestMirror.cs
deleted file mode 100644
index 832c785..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMirror.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestMirror : MonoBehaviour
-{
- HashSet<GameObject> m_Mirrored = new HashSet<GameObject>();
-
- private void OnTriggerEnter2D(Collider2D collision)
- {
- GameObject go = collision.gameObject;
- if (go && go.CompareTag("bullet") && !m_Mirrored.Contains(go))
- {
- //Debug.Log("mirror");
-
- go.GetComponent<TestBeamBullet>().direction.x = -go.GetComponent<TestBeamBullet>().direction.x;
-
- m_Mirrored.Add(go);
- }
- }
-
- private void OnTriggerExit2D(Collider2D collision)
- {
- GameObject go = collision.gameObject;
- if (go && go.CompareTag("bullet") && m_Mirrored.Contains(go))
- {
- m_Mirrored.Remove(go);
- }
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMirror.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestMirror.cs.meta
deleted file mode 100644
index 6fdba29..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMirror.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: bfd61ceb1fbec0944a66ace63dcd8e02
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs b/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs
deleted file mode 100644
index 4b5f637..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestMoveToTarget : MonoBehaviour
-{
- public float speed = 1;
-
- Vector2 target;
-
- SpriteRenderer sprite;
-
- private void Start()
- {
- sprite = GetComponent<SpriteRenderer>();
-
- }
-
- private void Update()
- {
- if (Input.GetButtonDown("Fire2"))
- {
- Vector3 screenPos = Input.mousePosition;
-
- target = Camera.main.ScreenToWorldPoint(screenPos);
- //Debug.Log(target);
- }
-
- Vector2 dir = Vector2.ClampMagnitude(target - (Vector2)transform.position, 1);
- Vector3 move = dir * speed * Time.deltaTime;
- transform.position = transform.position + move;
-
- float x = move.x;
- if (x > 0)
- {
- sprite.flipX = false;
- }
- else if (x < 0)
- {
- sprite.flipX = true;
- }
-
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs.meta
deleted file mode 100644
index 6f68458..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestMoveToTarget.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 2283c114a7cfbd1429d3e2a0d5e6a957
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs b/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs
deleted file mode 100644
index 11f76ba..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.Events;
-
-public class TestPeaceMaker : MonoBehaviour
-{
-
- [SerializeField] private Transform m_Camera;
- [SerializeField] private float m_Speed;
- [SerializeField] private Transform m_Centre;
- [SerializeField] private SpriteRenderer m_Arrow;
- [SerializeField] private float m_ArrowRadius;
- [SerializeField] private TestPeaceMakerBullet m_Bullet;
- [SerializeField] private TestPeaceMakerGrenade m_Grenade;
- [SerializeField] private Vector2 m_Zoom;
- [SerializeField] private GameObject m_LaunchVfx;
- [SerializeField] private Transform m_LaunchPoint;
- [SerializeField] private TestB2 m_B2;
- [SerializeField] private TestSpaceBeam m_SpaceBeam;
-
- private Vector3 zoomIn
- {
- get
- {
- Vector3 zin = new Vector3(m_Zoom.x, m_Zoom.x, 1);
- return zin;
- }
- }
- private Vector3 zoomOut
- {
- get
- {
- Vector3 zout = new Vector3(m_Zoom.y, m_Zoom.y, 1);
- return zout;
- }
- }
-
- private TopDownShadowCaster m_Shadow;
-
- private SpriteRenderer m_SpriteRenderer;
- private TopDownTransform m_Coord;
- private Coroutine m_CoFire;
- private Coroutine m_CoLaunchGrenade;
-
- private Vector3 m_PreMouse;
-
- private Vector2 m_AimDirection;
-
- private Vector3 m_TargetZoom;
-
- private enum ControlMode
- {
- Mouse,
- Joystick,
- }
- private ControlMode m_ControlMode;
-
- void Start()
- {
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
- m_Coord = GetComponent<TopDownTransform>();
-
- m_ControlMode = ControlMode.Mouse;
- m_AimDirection = Vector2.zero;
-
- m_TargetZoom = new Vector3(m_Zoom.x, m_Zoom.x, 1);
-
- m_Shadow = GetComponent<TopDownShadowCaster>();
- }
-
- void Update()
- {
- bool isMove = Move();
-
- SetAim();
-
- bool isFire = Fire();
- bool isGrenade = LaunchGrenade();
- bool isBeam = SpaceBeam();
-
- CallB2();
-
- CameraFollow();
-
- CameraZoom(/*isMove ||*/ isFire || isGrenade /*|| isBeam*/);
- }
-
- void CameraZoom(bool zout)
- {
- if(zout)
- {
- m_TargetZoom = zoomOut;
- m_Camera.localScale = Vector3.Lerp(m_Camera.localScale, m_TargetZoom, 0.25f);
- }
- else
- {
- m_TargetZoom = zoomIn;
- m_Camera.localScale = Vector3.Lerp(m_Camera.localScale, m_TargetZoom, /*Time.deltaTime * 2f*/0.25f);
- }
- }
-
- void CameraFollow()
- {
- Vector3 pos = m_Camera.position;
- pos.x = m_Coord.x;
- pos.y = m_Coord.y;
-
- if (Vector3.Distance(pos, m_Camera.position) > 0.1f)
- {
- m_Camera.position = Vector3.Lerp(m_Camera.position, pos, 3 * Time.deltaTime);
- }
- }
-
- bool Move()
- {
- float x = Input.GetAxisRaw("Horizontal");
- float y = Input.GetAxisRaw("Vertical");
-
- bool isMove = x != 0 || y != 0;
-
- if (isMove)
- {
- Vector2 direction = new Vector2(x, y).normalized;
-
- Vector3 position = m_Coord.position;
- position.x += direction.x * m_Speed * Time.deltaTime;
- position.y += direction.y * m_Speed * Time.deltaTime;
-
- m_Coord.position = position;
-
- if (x > 0)
- {
- m_SpriteRenderer.flipX = false;
- m_Shadow.Flip(false);
- }
- else if (x < 0)
- {
- m_SpriteRenderer.flipX = true;
- m_Shadow.Flip(true);
- }
- }
-
- return isMove;
- }
-
- void SetAim()
- {
- float xAxis = Input.GetAxisRaw("AimHorizontal");
- float yAxis = Input.GetAxisRaw("AimVertical");
-
- bool bJoytick = xAxis != 0 || yAxis != 0;
-
- bool bMouse = (Input.mousePosition - m_PreMouse).magnitude > 0.01f;
- m_PreMouse = Input.mousePosition;
-
- if(bJoytick)
- {
- m_ControlMode = ControlMode.Joystick;
- }
- if(bMouse)
- {
- m_ControlMode = ControlMode.Mouse;
- }
-
- Vector2 centrePos = m_Centre.position;
- Vector2 dir = Vector2.zero;
- if (m_ControlMode == ControlMode.Mouse)
- {
- Vector2 camPos = GetCameraPosition();
- dir = (camPos - centrePos).normalized;
- }
- else
- {
- dir = new Vector2(xAxis, -yAxis).normalized;
- }
-
- if(dir.magnitude > 0)
- {
- m_AimDirection = dir;
- Vector2 arrowPos = centrePos + m_ArrowRadius * m_AimDirection;
- m_Arrow.transform.position = new Vector3(arrowPos.x, arrowPos.y, m_Arrow.transform.position.z);
- m_Arrow.transform.rotation = Quaternion.Euler(0, 0, Mathf.Atan2(m_AimDirection.y, m_AimDirection.x) * Mathf.Rad2Deg);
- }
- }
-
- Vector2 GetCameraPosition()
- {
- Vector3 screenPos = Input.mousePosition;
- Vector2 target = Camera.main.ScreenToWorldPoint(screenPos);
- return target;
- }
-
- bool Fire()
- {
- if (Input.GetButtonDown("Fire1") || (Input.GetAxis("GunTrigger") == 1))
- {
- if (m_CoFire == null)
- {
- m_CoFire = StartCoroutine(coFire(0.1f));
- }
- }
- if (!Input.GetButton("Fire1") && (Input.GetAxis("GunTrigger") == 0))
- {
- if(m_CoFire != null)
- {
- StopCoroutine(m_CoFire);
- m_CoFire = null;
- }
- return false;
- }
- return true;
- }
-
- bool LaunchGrenade()
- {
- if (Input.GetButtonDown("Fire2") || (Input.GetAxis("BombTrigger") == 1))
- {
- if (m_CoLaunchGrenade == null)
- {
- m_CoLaunchGrenade = StartCoroutine(coLaunchGrenade(0.2f));
- }
- }
- if (!Input.GetButton("Fire2") && (Input.GetAxis("BombTrigger") == 0))
- {
- if (m_CoLaunchGrenade != null)
- {
- StopCoroutine(m_CoLaunchGrenade);
- m_CoLaunchGrenade = null;
- }
- return false;
- }
- return true;
- }
-
- IEnumerator coFire(float interval)
- {
- while (true)
- {
- CreateBullet(m_AimDirection, 12f, 2f);
- //CreateBullet(TestMathHelper.Rotate(m_AimDirection, 10 * Mathf.Deg2Rad), 12f, 2f);
- //CreateBullet(TestMathHelper.Rotate(m_AimDirection, -10 * Mathf.Deg2Rad), 12f, 2f);
-
- yield return new WaitForSeconds(interval);
- }
- }
-
- TestPeaceMakerBullet CreateBullet(Vector2 dir, float speed, float lifeTime)
- {
- TestPeaceMakerBullet bullet = Instantiate<TestPeaceMakerBullet>(m_Bullet);
-
- bullet.transform.position = m_Arrow.transform.position + new Vector3(m_AimDirection.x, m_AimDirection.y, 0) * -0.3f;
-
- bullet.Set(dir, speed, lifeTime);
- bullet.gameObject.SetActive(true);
-
- return bullet;
- }
-
-
- Vector3 GetRandomLaunchGrenadeDirection()
- {
- Vector3 dirOnPlane = Quaternion.Euler(0, 0, Random.Range(-15f, 15f)) * new Vector3(m_AimDirection.x, m_AimDirection.y, 0);
- dirOnPlane = dirOnPlane.normalized;
- Vector3 dir = new Vector3(dirOnPlane.x, dirOnPlane.y, Random.Range(0f, 1f)).normalized;
- return dir.normalized;
- }
-
- IEnumerator coLaunchGrenade(float interval)
- {
- while (true)
- {
- // grenade
- TestPeaceMakerGrenade grenade = Instantiate<TestPeaceMakerGrenade>(m_Grenade);
- Vector3 position = m_Coord.position + new Vector3(0, 0, 1.8f);
- grenade.Set(position, GetRandomLaunchGrenadeDirection(), Random.Range(8f, 10f));
- grenade.gameObject.SetActive(true);
-
- // vfx
- GameObject eff = Instantiate<GameObject>(m_LaunchVfx, this.transform);
- eff.transform.position = m_LaunchPoint.transform.position;
- eff.SetActive(true);
-
- yield return new WaitForSeconds(interval);
- }
- }
-
- void CallB2()
- {
- if(Input.GetButtonDown("Fire3"))
- {
- TestB2 b2 = Instantiate<TestB2>(m_B2);
-
- Vector3 pos3D = m_Coord.GetProjectedPosition();
- b2.Set(pos3D + new Vector3(-15, 0,0 ), pos3D + new Vector3(15, 0,0 ), 20f, 3f);
- }
- }
-
- bool SpaceBeam()
- {
- if (Input.GetButtonDown("SpaceBeam"))
- {
- TestSpaceBeam beam = Instantiate<TestSpaceBeam>(m_SpaceBeam);
-
- Vector3 pos3D = m_Coord.position;
- beam.Set(pos3D + new Vector3(3, 0, 0));
-
- TinyCountDown.Instance.Set("SpaceBeam", 0.1f);
- return true;
- }
- return TinyCountDown.Instance.Get("SpaceBeam") > 0;
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs.meta
deleted file mode 100644
index e8f0316..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMaker.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e1b4df1c072214a4f947497f833281d9
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs b/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs
deleted file mode 100644
index 8229753..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestPeaceMakerBullet : MonoBehaviour
-{
-
- private Vector2 m_Direction;
-
- private float m_Speed;
-
- private float m_LifeTime;
-
- public void Set(Vector2 dir, float speed, float lifeTime)
- {
- m_Direction = dir;
- m_Speed = speed;
- m_LifeTime = lifeTime;
- transform.rotation = Quaternion.Euler(0, 0, Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg);
- }
-
- void Update()
- {
- m_LifeTime -= Time.deltaTime;
- if(m_LifeTime <= 0)
- {
- Destroy(this.gameObject);
- return;
- }
-
- Vector2 move = m_Direction * m_Speed * Time.deltaTime;
-
- Vector3 pos = transform.position;
- pos.x += move.x;
- pos.y += move.y;
-
- transform.position = pos;
- }
-
- private void OnTriggerEnter2D(Collider2D collision)
- {
- TestBucket bucket = collision.gameObject.GetComponent<TestBucket>();
-
- if (bucket)
- {
- bucket.Broken();
- }
-
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs.meta
deleted file mode 100644
index c3bce5a..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerBullet.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cf74c7651403bc449b55858cefd8debb
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs b/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs
deleted file mode 100644
index 021eda7..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestPeaceMakerGrenade : MonoBehaviour
-{
-
- [SerializeField] private float m_GravityScale = 1f;
-
- [SerializeField] private GameObject m_ExplosionEffect;
-
- private TopDownTransform m_Coords;
-
- private Vector3 GRAVITY = new Vector3(0, 0, -9.8f);
-
- private Vector3 m_Velocity; // x, y, fakeHeight
-
- /// <summary>
- /// 设置初始参数,都在fake空间下
- /// </summary>
- /// <param name="initPosition"></param>
- /// <param name="initDirection"></param>
- /// <param name="initSpeed"></param>
- public void Set(Vector3 initPosition, Vector3 initDirection, float initSpeed)
- {
- m_Coords = GetComponent<TopDownTransform>();
- m_Coords.position = initPosition;
-
- m_Velocity = initDirection * initSpeed;
- }
-
- private void Update()
- {
- Vector3 move = m_Velocity * Time.deltaTime;
-
- if(m_Velocity.magnitude > 0 && m_Coords.z + move.z >= 0)
- {
- m_Coords.x += move.x;
- m_Coords.y += move.y;
- m_Coords.z += move.z;
- m_Velocity += GRAVITY * Time.deltaTime;
-
- transform.rotation *= Quaternion.Euler(0, 0, 100 * m_Velocity.magnitude * Time.deltaTime);
- }
- else
- {
- m_Velocity = Vector3.zero;
-
- this.gameObject.SetActive(false);
- Destroy(this.gameObject);
- PlayExplosion();
- }
- }
-
- private void PlayExplosion()
- {
- GameObject exp = Instantiate<GameObject>(m_ExplosionEffect);
-
- TopDownTransform coord = exp.GetComponent<TopDownTransform>();
- coord.position = m_Coords.position;
-
- exp.GetComponent<TopDownSorting>().Sorting();
-
- exp.SetActive(true);
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs.meta
deleted file mode 100644
index 7b95df6..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPeaceMakerGrenade.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 40fc919f136c67e41a3608549bab3217
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs b/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs
deleted file mode 100644
index a1606f2..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestPhysicsHelper : TestSingleton<TestPhysicsHelper>
-{
- public TestPhysicsHelper()
- {
- }
-
-
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs.meta
deleted file mode 100644
index 47ba3fc..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestPhysicsHelper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 8031513d870e5e54e942664031efe406
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs b/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs
deleted file mode 100644
index 367a661..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestRobot1 : MonoBehaviour
-{
- public Transform shadow;
-
- public float x = 0;
- public float y = -0.628f;
- public float z; // fake height
-
- public AnimationCurve curve;
- public AnimationCurve curveX;
- public AnimationCurve curveY;
-
- private void Update()
- {
- x = curveX.Evaluate(Time.time % 1f);
- y = curveY.Evaluate(Time.time % 1f);
- z = curve.Evaluate(Time.time % 1f);
-
- Vector3 pos = transform.position;
- pos.x = x;
- pos.y = y + z;
-
- transform.position = pos;
-
- pos.y = y;
- shadow.transform.position = pos;
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs.meta
deleted file mode 100644
index 554affe..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestRobot1.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 04de5fad9d56a774498cac6d58b2f231
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs b/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs
deleted file mode 100644
index fca1bff..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using UnityEngine;
-
-[ExecuteInEditMode]
-public class TestSceneViewShaderHelper : MonoBehaviour
-{
-#if UNITY_EDITOR
- private int _isSceneViewID = Shader.PropertyToID("_IsSceneView");
-
- public void OnEnable()
- {
- Camera.onPreRender += SetIfSceneViewCamera;
- }
-
- public void OnDisable()
- {
- Camera.onPreRender -= SetIfSceneViewCamera;
- }
-
- public void SetIfSceneViewCamera(Camera cam)
- {
- // Scene View camera is named "SceneCamera"
- if (cam.gameObject.name == "SceneCamera")
- {
- Shader.EnableKeyword("SCENE_VIEW");
- Shader.SetGlobalFloat(_isSceneViewID, 1f);
- }
- // Inspector preview for materials, models, and prefabs is named "Preview Scene Camera"
- // else if (cam.gameObject.name == "Preview Scene Camera")
- // {
- // Shader.EnableKeyword("SCENE_VIEW");
- // Shader.SetGlobalFloat(_isSceneViewID, 2f);
- // }
- // Otherwise this is a game view or other user camera
- else
- {
- Shader.DisableKeyword("SCENE_VIEW");
- Shader.SetGlobalFloat(_isSceneViewID, 0f);
- }
-
- // You can double check the camera names if something breaks in the future
- // Debug.Log(cam);
- }
-#endif
-}
- \ No newline at end of file
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs.meta
deleted file mode 100644
index 4b846fc..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSceneViewShaderHelper.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 8b08476505e1d804994534220f308b69
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs b/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs
deleted file mode 100644
index d1819c0..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestSeperator : MonoBehaviour
-{
- HashSet<GameObject> m_Seperated = new HashSet<GameObject>();
-
- private void OnTriggerEnter2D(Collider2D collision)
- {
- GameObject go = collision.gameObject;
- if (go && go.CompareTag("bullet") && !m_Seperated.Contains(go))
- {
- //Debug.Log("seperate");
-
- TestBeamBullet bullet1 = TestBeamBullet.Instantiate(go.GetComponent<TestBeamBullet>());
- bullet1.direction = Quaternion.Euler(0,0, 30) * bullet1.direction;
- bullet1.enabled = true;
- bullet1.gameObject.SetActive(true);
-
- TestBeamBullet bullet2 = TestBeamBullet.Instantiate(go.GetComponent<TestBeamBullet>());
- bullet2.direction = Quaternion.Euler(0, 0, -30) * bullet2.direction;
- bullet2.enabled = true;
- bullet2.gameObject.SetActive(true);
-
- m_Seperated.Add(go);
- m_Seperated.Add(bullet1.gameObject);
- m_Seperated.Add(bullet2.gameObject);
- }
- }
-
- private void OnTriggerExit2D(Collider2D collision)
- {
- GameObject go = collision.gameObject;
- if (go.CompareTag("bullet") && m_Seperated.Contains(go))
- {
- m_Seperated.Remove(go);
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs.meta
deleted file mode 100644
index 58f5ccb..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSeperator.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: ec780be79a9ec774b80c4ba5593c3a39
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs b/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs
deleted file mode 100644
index d522653..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-public class TestSingleton<T> where T : class, new()
-{
- private static T _instance;
- private static readonly object syslock = new object();
-
- public static T getInstance()
- {
- if (_instance == null)
- {
- lock (syslock)
- {
- if (_instance == null)
- {
- _instance = new T();
- }
- }
- }
- return _instance;
- }
-} \ No newline at end of file
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs.meta
deleted file mode 100644
index 8035c63..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSingleton.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 0e4486fb2a577bb4fa367c939cd96141
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSorting.cs b/AlienSurvival/Assets/Scripts/Test/TestSorting.cs
deleted file mode 100644
index 7a2cf54..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSorting.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestSorting : MonoBehaviour
-{
- //private void Update()
- //{
- // Vector3 pos = transform.position;
- // pos.z = pos.y - 5;
-
- // if(transform.position.z != pos.z)
- // {
- // transform.position = pos;
- // }
- //}
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSorting.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSorting.cs.meta
deleted file mode 100644
index 56c5ed0..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSorting.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: c6f36e1896ea64642b621e21a00a6488
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs b/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs
deleted file mode 100644
index 6e346ec..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestSortingByDepth : MonoBehaviour
-{
-
-
-} \ No newline at end of file
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs.meta
deleted file mode 100644
index 934c164..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSortingByDepth.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 540605b09e537394f84b35d5bd77a505
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs b/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs
deleted file mode 100644
index 59f44b7..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestSortingByY : MonoBehaviour
-{
- // Start is called before the first frame update
- void Start()
- {
-
- }
-
- // Update is called once per frame
- void Update()
- {
-
- }
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs.meta
deleted file mode 100644
index 5074c7f..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSortingByY.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9a346df7f7a231e46bfeb3dbc1a63116
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs b/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs
deleted file mode 100644
index b8ce07b..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-/// <summary>
-/// 太空射线
-/// </summary>
-public class TestSpaceBeam : MonoBehaviour
-{
- [SerializeField] private GameObject m_Beam;
-
- TopDownTransform m_Coord;
-
- List<GameObject> m_Beams = new List<GameObject>();
-
- float m_RotateSpeed = 5f;
-
- float m_Radius = 1f;
-
- int count = 8;
-
- float m_CurrentAngle = 0;
-
- private void Awake()
- {
- m_Coord = GetComponent<TopDownTransform>();
- }
-
- public void Set(Vector3 posTDS)
- {
- m_Coord.position = posTDS;
-
- Vector3 groundPos = m_Coord.positionOnGround;
-
- for(int i = 0; i < count; ++i)
- {
- float angle = Mathf.PI * 2f / (float)count * i;
- Vector3 pos = /*groundPos +*/ new Vector3(m_Radius * Mathf.Cos(angle), m_Radius * Mathf.Sin(angle), 0f);
- GameObject beam = Instantiate<GameObject>(m_Beam, this.transform);
- beam.GetComponent<TopDownTransform>().localPosition = pos;
- beam.SetActive(true);
- m_Beams.Add(beam);
- }
- }
-
- void Update()
- {
- m_CurrentAngle += m_RotateSpeed * Time.deltaTime;
-
- RotateBeams(m_CurrentAngle);
- }
-
- /// <summary>
- /// 旋转
- /// </summary>
- /// <param name="angle">弧度</param>
- void RotateBeams(float angle)
- {
- Vector3 groundPos = m_Coord.positionOnGround;
-
- for (int i = 0; i < m_Beams.Count; ++i)
- {
- float rad = angle + Mathf.PI * 2f / (float)count * i;
- Vector3 pos = /*groundPos + */new Vector3(m_Radius * Mathf.Cos(rad), m_Radius * Mathf.Sin(rad), 0f);
- m_Beams[i].GetComponent<TopDownTransform>().localPosition = pos;
- }
-
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs.meta
deleted file mode 100644
index 3e008d2..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestSpaceBeam.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 345857a5337aab0458bb084b716eccdc
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs b/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs
deleted file mode 100644
index acfac68..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestTopDown2DTransform : MonoBehaviour
-{
- public bool useGravity = false;
-
- public Vector3 position // x, y, h
- {
- get
- {
- Vector3 topdownPos = transform.position;
- topdownPos.y -= h;
- topdownPos.z = h;
- return topdownPos;
- }
- set
- {
- h = value.z;
- Vector3 realPos = transform.position;
- realPos.y = value.y + h;
- transform.position = realPos;
- }
- }
-
- public float x
- {
- get
- {
- return position.x;
- }
- }
-
- public float y
- {
- get
- {
- return position.y;
- }
- }
-
- public float h = 0;
-
- public float z
- {
- get
- {
- return transform.position.z;
- }
- }
-
- public float depth
- {
- get
- {
- return this.z;
- }
- }
-
- private float vy = 0;
-
- private void Update()
- {
- if (useGravity)
- {
- Vector3 pos = position;
- vy += -9.8f * Time.deltaTime;
- pos.z = Mathf.Max(pos.z + vy * Time.deltaTime, 0f);
- if(pos.z == 0)
- {
- vy = 0;
- }
- position = pos;
- }
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs.meta
deleted file mode 100644
index b8279be..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestTopDown2DTransform.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 65a986ca41323a44c910b7d7660abf9c
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs b/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs
deleted file mode 100644
index 3a73d21..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class TestWaspRobot : MonoBehaviour
-{
- [SerializeField] private TopDownTransform m_Follow;
-
- [SerializeField] private float m_MoveSpeed;
-
- private SpriteRenderer m_SpriteRenderer;
- private TopDownTransform m_Coords;
-
- // wasp环绕
- [SerializeField] private float m_Radius;
-
- [SerializeField] private List<Sprite> m_Sprites;
-
- private bool m_Following;
-
- private float m_Angle;
-
- private float m_OrbitSpeed = 3f;
-
- enum State
- {
- None,
- Move,
- Orbit,
- }
-
- private State m_State = State.None;
-
- private Coroutine m_Coroutine;
-
- private void Start()
- {
- m_SpriteRenderer = GetComponent<SpriteRenderer>();
- m_Coords = GetComponent<TopDownTransform>();
-
- m_Following = false;
- m_Angle = 0;
-
- ChangeState(State.Move);
- }
-
- private void ChangeState(State state)
- {
- if(m_State != state)
- {
- //Debug.Log(m_State.ToString() + "->" + state.ToString());
-
- if(m_Coroutine != null)
- {
- StopCoroutine(m_Coroutine);
- }
- m_State = state;
- m_Coroutine = StartCoroutine("co" + m_State.ToString());
- }
- }
-
- void Update()
- {
-
- float distance = (m_Follow.positionOnGround - m_Coords.positionOnGround).magnitude;
- m_Following = distance > m_Radius + 0.1f;
-
- if(m_Following)
- {
- ChangeState(State.Move);
- }
- else
- {
- ChangeState(State.Orbit);
- }
-
- }
-
- IEnumerator coMove()
- {
- while (true)
- {
- if (m_Following)
- {
- Vector2 dir = (m_Follow.positionOnGround - m_Coords.positionOnGround).normalized;
-
- Vector2 posOnGround = m_Coords.positionOnGround;
- posOnGround.x += m_MoveSpeed * Time.deltaTime * dir.x;
- posOnGround.y += m_MoveSpeed * Time.deltaTime * dir.y;
-
- m_Coords.positionOnGround = posOnGround;
-
- float rad = GetAngleToTarget();
-
- int index = GetSpriteIndex(rad);
- SetSprite(index);
- }
-
- yield return null;
- }
- }
-
- IEnumerator coOrbit()
- {
- m_Angle = GetAngleToTarget();
-
- while (true)
- {
- m_Angle += Time.deltaTime * m_OrbitSpeed;
-
- Vector2 centre = m_Follow.positionOnGround;
- centre += new Vector2(Mathf.Cos(m_Angle), Mathf.Sin(m_Angle)).normalized * m_Radius;
- m_Coords.positionOnGround = Vector2.Lerp(m_Coords.positionOnGround, centre, 0.25f);
-
- int index = GetSpriteIndex(m_Angle);
- SetSprite(index);
-
- yield return null;
- }
- }
-
- float GetAngleToTarget()
- {
- Vector2 posOnGround = m_Coords.positionOnGround;
- Vector2 target = m_Follow.positionOnGround;
-
- Vector2 dir = (posOnGround - target).normalized;
-
- return Mathf.Atan2(dir.y, dir.x) + 2 * Mathf.PI * TestMathHelper.Check(dir.y < 0);
- }
-
- // angle rad
- int GetSpriteIndex(float rad)
- {
- int index = ((int)Mathf.Floor(((rad * Mathf.Rad2Deg) % 360) / 30)) % 12;
- index = Mathf.Clamp(index, 0, m_Sprites.Count - 1);
- return index;
- }
-
- void SetSprite(int index)
- {
- m_SpriteRenderer.sprite = m_Sprites[index];
- }
-
-}
diff --git a/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs.meta b/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs.meta
deleted file mode 100644
index 9bd17eb..0000000
--- a/AlienSurvival/Assets/Scripts/Test/TestWaspRobot.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 37e797e79063cdf4883cf54509d9ddc3
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant: