2. Завершен.

2.3  Выбор оружия из меню.
This commit is contained in:
DyatelO 2021-10-25 19:48:00 +03:00
parent bccbc95f32
commit cf4f418d4f
17 changed files with 1571 additions and 106 deletions

View File

@ -4923,13 +4923,10 @@ MonoBehaviour:
m_GameObject: {fileID: 1801060021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7eb9aa66cf2083c4b810af683ee33947, type: 3}
m_Script: {fileID: 11500000, guid: 24318c8c1ca83a54ba0ec54a5fe253e7, type: 3}
m_Name:
m_EditorClassIdentifier:
_weaponType: 2
_weaponlist:
- {fileID: 11400000, guid: 92504437725aa854c98196750a332319, type: 2}
- {fileID: 11400000, guid: ee4c4a79d615ec7479a4c1c287803cec, type: 2}
_weapon: {fileID: 0}
--- !u!1001 &1850245407
PrefabInstance:
m_ObjectHideFlags: 0
@ -5196,7 +5193,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1923264931}
m_LocalRotation: {x: 0.5257311, y: -0.000000007318311, z: 0.000000004522964, w: 0.85065085}
m_LocalPosition: {x: 28.920218, y: 13, z: -33.96894}
m_LocalPosition: {x: 18.657974, y: 13, z: -22.65812}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 905416317}

View File

@ -5194,13 +5194,10 @@ MonoBehaviour:
m_GameObject: {fileID: 1801060021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7eb9aa66cf2083c4b810af683ee33947, type: 3}
m_Script: {fileID: 11500000, guid: 24318c8c1ca83a54ba0ec54a5fe253e7, type: 3}
m_Name:
m_EditorClassIdentifier:
_weaponType: 2
_weaponlist:
- {fileID: 11400000, guid: 92504437725aa854c98196750a332319, type: 2}
- {fileID: 11400000, guid: ee4c4a79d615ec7479a4c1c287803cec, type: 2}
_weapon: {fileID: 0}
--- !u!1001 &1850245407
PrefabInstance:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DirectWeapon : MonoBehaviour
{
[SerializeField] private List<PlayerAction> _weaponlist = new List<PlayerAction>();
private AttackEnergyController _attackEnergiController;
public void SetWeapon(int index)
{
//_index = index;
StateWeapon._chosenWeapon = _weaponlist[index];
if(index == 0)
{
StateWeapon._resetTime = 3f;
StateWeapon._attackCost = 1f;
}
if(index == 1)
{
StateWeapon._resetTime = 2f;
StateWeapon._attackCost = 0.5f;
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7a5ca1da5111a8f4ab9191518c8ec02f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- _setWeapon: {fileID: 11400000, guid: ee4c4a79d615ec7479a4c1c287803cec, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MainWeapon : MonoBehaviour
{
[SerializeField] private PlayerAction _weapon;
private PlayerState _characterWeapon;
private AttackEnergyController _attackEnergiController;
private DirectWeapon _directWeapon;
//private StateWeapon _stateWeapon;
private float _attackResetTime;
private float _attackCost;
private void Awake()
{
_attackEnergiController = GetComponent<AttackEnergyController>();
_weapon = StateWeapon._chosenWeapon;
_characterWeapon = GetComponent<PlayerState>();
_characterWeapon.defaultAction = _weapon;
_attackResetTime = StateWeapon._resetTime;
_attackCost = StateWeapon._attackCost;
_attackEnergiController.attackResetTime = _attackResetTime;
_attackEnergiController.attackCost = _attackCost;
// _attackEnergiController.attackResetTime = 2f;
// _attackEnergiController.attackCost = 0.5f;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 24318c8c1ca83a54ba0ec54a5fe253e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StateWeapon : MonoBehaviour
{
public static PlayerAction _chosenWeapon;
public static float _resetTime;
public static float _attackCost;
//private void SetWeaponType()
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c93766c9520e86346963e5d55048819b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2,18 +2,23 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SwitchWeapon : MonoBehaviour
{
public enum TypeOfWeapon
{
Bolt,
Laser,
Random
}
public class SwitchWeapon : MonoBehaviour
{
// public enum TypeOfWeapon
// {
// Bolt,
// Laser,
// Random
// }
[SerializeField] private TypeOfWeapon _weaponType;
[SerializeField] private List<PlayerAction> _weaponlist = new List<PlayerAction>();
private PlayerState _playerState;
private AttackEnergyController _attackEnergiController; // = new AttackEnergyController();
@ -24,6 +29,7 @@ public class SwitchWeapon : MonoBehaviour
_attackEnergiController = GetComponent<AttackEnergyController>();
_playerState = GetComponent<PlayerState>();
//_weapon = StateWeapon._chosenWeapon;
ChangehWeapon(_weaponType);
}
@ -61,6 +67,11 @@ public class SwitchWeapon : MonoBehaviour
_attackEnergiController.attackCost = 0.5f;
}
}
public void Switcher(PlayerAction weaponScript)
{
}
}

View File

@ -0,0 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WeaponDefalult : MonoBehaviour
{
[SerializeField] private PlayerAction _defaultWeapon;
private PlayerState _playState;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2609a987e747a9c4d857f1a043e86a50
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 79d7be7d5a534d1489890f3a40c093ae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -0,0 +1,216 @@
fileFormatVersion: 2
guid: abec8c13117bc46418f08d21fd3ce03f
TextureImporter:
internalIDToNameTable:
- first:
213: -7919862267684303087
second: 4. Sprite_Weapons_0
- first:
213: 3529690459429910812
second: 4. Sprite_Weapons_1
- first:
213: -9071853004870451029
second: 4. Sprite_Weapons_2
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 4
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 500
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 5
flipbookColumns: 6
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 1
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 1
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: 4. Sprite_Weapons_0
rect:
serializedVersion: 2
x: 484
y: 679
width: 112
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 11f48a09a3ff61290800000000000000
internalID: -7919862267684303087
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: 4. Sprite_Weapons_1
rect:
serializedVersion: 2
x: 55
y: 32
width: 438
height: 619
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: c19b76195cafbf030800000000000000
internalID: 3529690459429910812
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: 4. Sprite_Weapons_2
rect:
serializedVersion: 2
x: 593
y: 32
width: 438
height: 619
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: ba0032eb1cd4a1280800000000000000
internalID: -9071853004870451029
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 8ac29151b4e30314a8759378ce77f820
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long