Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class EntitySolider : EntityTroop {
- private SoliderType type;
- private string name;
- private int id;
- private static GameObject solider;
- private Sprite soliderStandart = Resources.Load<Sprite>("Textures/solider");
- public EntitySolider(SoliderType type, string name, int id, GameObject parent) {
- this.type = type;
- this.name = name;
- this.id = id;
- solider = new GameObject();
- solider.name = name;
- solider.transform.position = new Vector3(-40, 20, 0);
- solider.transform.parent = parent.transform;
- solider.transform.localScale = new Vector2(0.15f, 0.15f);
- Image image = solider.AddComponent<Image>();
- switch (this.type) {
- case SoliderType.STANDARD:
- image.sprite = soliderStandart;
- break;
- default:
- break;
- }
- }
- public static void Update () {
- Debug.Log(solider);
- solider.transform.position += Vector3.right * 0.25f;
- }
- public string GetName () {
- return this.name;
- }
- public int GetId () {
- return this.id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment