diff --git a/Assets/UnitBehaviour.cs b/Assets/UnitBehaviour.cs new file mode 100644 index 0000000..16da57b --- /dev/null +++ b/Assets/UnitBehaviour.cs @@ -0,0 +1,80 @@ +using UnityEngine; +using System.Collections; + +public class UnitBehaviour : MonoBehaviour { + + public enum Elemental { + None = 0, + Fire, + Ice, + Size + } + + public enum Team { + None = 0, + Player, + Enemy1, + Enemy2, + Enemy3, + Size + } + + public int actionsPerTurn = 2; + public int remainingActions; + public int stepLength = 5; + public int precision = 50; + public int critChance = 10; + public int health = 4; + public int armour = 0; + public int mana = 0; + public Elemental element = Elemental.None; + public Team teamID = Team.Player; + public int posX; + public int posY; + + public int attackRange = 1; + public int attackArea = 1; + public int attackDamage = 1; + public Elemental attackElem = Elemental.None; + + public void SetupStats (int pX, int pY, int actions = 2, int steps = 5, int p = 50, int crit = 10, int pRange = 20, int critRange = 10) { + posX = pX; + posY = pY; + actionsPerTurn = actions; + stepLength = steps; + if (pRange > 0) { + precision = p - pRange / 2 + Random.Range (0, pRange); + if (precision < 0) + precision = 0; + } + else + precision = p; + if (critRange > 0) { + critChance = crit - critRange / 2 + Random.Range (0, critRange); + if (critChance < 0) + critChance = 0; + } else + critChance = crit; + } + + public void SetupBaseAttack (int r = 1, int a = 1, int d = 1, Elemental e = Elemental.None) { + attackRange = r; + attackArea = a; + attackDamage = d; + attackElem = e; + } + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } + + public void Die () { + Destroy (gameObject); + } +} diff --git a/Assets/UnitBehaviour.cs.meta b/Assets/UnitBehaviour.cs.meta new file mode 100644 index 0000000..383ab2c --- /dev/null +++ b/Assets/UnitBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f685a25083417604590f9afdb346f66f +timeCreated: 1477692281 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnitCreator.cs b/Assets/UnitCreator.cs new file mode 100644 index 0000000..d8a4451 --- /dev/null +++ b/Assets/UnitCreator.cs @@ -0,0 +1,46 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +public class UnitCreator : MonoBehaviour { + + public GameObject lichObject; + public UnitBehaviour playerLich; + public GameObject skeletonObject; + public List units; + + private UnitBehaviour script; + + public enum UnitType { + Lich = 0, + Skeleton, + Size + } + + // Use this for initialization + void Start () { + units = new List (); + } + + // Update is called once per frame + void Update () { + + } + + void createUnit(int posX, int posY, Vector3 posVec3, UnitBehaviour.Team team, UnitType type = UnitType.Skeleton) { + GameObject lich; + + if (type == UnitType.Lich) { + lich = Instantiate (lichObject, posVec3, Quaternion.identity); + lich.GetComponent ().SetupStats (posX, posY, 3, 3, 100, 0, 0, 0); + lich.GetComponent ().SetupBaseAttack (4, 2, 3); + + if (team == UnitBehaviour.Team.Player) + playerLich = lich.GetComponent (); + } else if (type == UnitType.Skeleton) { + GameObject skeleton; + skeleton = Instantiate (skeletonObject, posVec3, Quaternion.identity); + units.Add (skeleton); + } + } +} diff --git a/Assets/UnitCreator.cs.meta b/Assets/UnitCreator.cs.meta new file mode 100644 index 0000000..927c2c4 --- /dev/null +++ b/Assets/UnitCreator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 13406b49a56381848a308c08e10f47dc +timeCreated: 1477694839 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/lichModel.prefab b/Assets/lichModel.prefab new file mode 100644 index 0000000..da04188 --- /dev/null +++ b/Assets/lichModel.prefab @@ -0,0 +1,121 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000013980076266} + m_IsPrefabParent: 1 +--- !u!1 &1000013980076266 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013759539232} + - 33: {fileID: 33000012584896150} + - 136: {fileID: 136000012491019400} + - 23: {fileID: 23000010927721588} + - 114: {fileID: 114000011455505298} + m_Layer: 0 + m_Name: lichModel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000013759539232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013980076266} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!23 &23000010927721588 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013980076266} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &33000012584896150 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013980076266} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114000011455505298 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013980076266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f685a25083417604590f9afdb346f66f, type: 3} + m_Name: + m_EditorClassIdentifier: + actionsPerTurn: 2 + remainingActions: 0 + stepLength: 5 + precision: 50 + critChance: 10 + health: 4 + armour: 0 + mana: 0 + element: 0 + teamID: 1 + posX: 0 + posY: 0 + attackRange: 1 + attackArea: 1 + attackDamage: 1 + attackElem: 0 +--- !u!136 &136000012491019400 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013980076266} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/lichModel.prefab.meta b/Assets/lichModel.prefab.meta new file mode 100644 index 0000000..dcaf00e --- /dev/null +++ b/Assets/lichModel.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 055ce9e83be0bd140a3e7aa52d871817 +timeCreated: 1477697442 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/unitCreator.prefab b/Assets/unitCreator.prefab new file mode 100644 index 0000000..bbfceb0 --- /dev/null +++ b/Assets/unitCreator.prefab @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000012081215776} + m_IsPrefabParent: 1 +--- !u!1 &1000012081215776 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010866040730} + - 114: {fileID: 114000012745315038} + m_Layer: 0 + m_Name: unitCreator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010866040730 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012081215776} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &114000012745315038 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012081215776} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 13406b49a56381848a308c08e10f47dc, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/unitCreator.prefab.meta b/Assets/unitCreator.prefab.meta new file mode 100644 index 0000000..8b2cc60 --- /dev/null +++ b/Assets/unitCreator.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afbffbb7b9d986345b62d4e4b7969551 +timeCreated: 1477697986 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 586998d..4405242 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -123,7 +123,6 @@ PlayerSettings: iPhoneTargetOSVersion: 24 tvOSSdkVersion: 0 tvOSTargetOSVersion: 900 - tvOSRequireExtendedGameController: 0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -163,7 +162,6 @@ PlayerSettings: iOSLaunchScreeniPadCustomXibPath: iOSDeviceRequirements: [] iOSURLSchemes: [] - appleDeveloperTeamID: AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -199,15 +197,12 @@ PlayerSettings: wiiUSystemHeapSize: 128 wiiUTVStartupScreen: {fileID: 0} wiiUGamePadStartupScreen: {fileID: 0} - wiiUDrcBufferDisabled: 0 wiiUProfilerLibPath: actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 - cameraUsageDescription: locationUsageDescription: - microphoneUsageDescription: XboxTitleId: XboxImageXexPath: XboxSpaPath: @@ -247,8 +242,7 @@ PlayerSettings: ps4AppType: 0 ps4ParamSfxPath: ps4VideoOutPixelFormat: 0 - ps4VideoOutInitialWidth: 1920 - ps4VideoOutReprojectionRate: 120 + ps4VideoOutResolution: 4 ps4PronunciationXMLPath: ps4PronunciationSIGPath: ps4BackgroundImagePath: @@ -277,12 +271,9 @@ PlayerSettings: ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 - ps4UseResolutionFallback: 0 - restrictedAudioUsageRights: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 ps4SocialScreenEnabled: 0 - ps4ScriptOptimizationLevel: 3 ps4Audio3dVirtualSpeakerCount: 14 ps4attribCpuUsage: 0 ps4PatchPkgPath: @@ -415,10 +406,16 @@ PlayerSettings: XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 intPropertyNames: + - Android::ScriptingBackend - Standalone::ScriptingBackend - WebPlayer::ScriptingBackend + - iOS::Architecture + - iOS::ScriptingBackend + Android::ScriptingBackend: 0 Standalone::ScriptingBackend: 0 WebPlayer::ScriptingBackend: 0 + iOS::Architecture: 2 + iOS::ScriptingBackend: 1 boolPropertyNames: - Android::VR::enable - Metro::VR::enable diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index ae41cb6..96b25e7 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.4.2f2 +m_EditorVersion: 5.4.1f1 m_StandardAssetsVersion: 0