Skip to content

Commit

Permalink
Merge pull request #1 from sddd1234567/feature/add-tutorial-levels
Browse files Browse the repository at this point in the history
add tutorial levels and main scene
  • Loading branch information
sddd1234567 committed Nov 29, 2022
2 parents 6114348 + fcf7fd2 commit c914263
Show file tree
Hide file tree
Showing 1,496 changed files with 96,943 additions and 17,246 deletions.
35 changes: 35 additions & 0 deletions .collabignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ===========================
# Default Collab Ignore Rules
# ===========================

# OS Generated
# ============
.DS_Store
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
[Tt]humbs.db
[Dd]esktop.ini

# Visual Studio / MonoDevelop generated
# =====================================
[Ee]xported[Oo]bj/
*.userprefs
*.csproj
*.pidb
*.suo
*.sln
*.user
*.unityproj
*.booproj

# Unity generated
# ===============
/[Tt]emp/
[Oo]bj/
[Bb]uild
/[Ll]ibrary/
sysinfo.txt
*.stackdump
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

Library/*
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

# Recordings can get excessive in size
/[Rr]ecordings/

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.app

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
104 changes: 104 additions & 0 deletions Assets/AccountInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AccountInfo : MonoBehaviour {
public int exp;
public int gold;
public int skillChip;

public Image playerIcon;
public Text lvText;
public Text goldText;
public Text skillChipText;
public Text levelName;
public Text title;

public Text boardGold;
public Text boardSkillChip;
public Text firstTimeText;
public static AccountInfo instance;

public Slider expBar;

public bool isWin;

void Awake() {
instance = this;
}

void Start() {
title.text = "";
}

void FixedUpdate() {
boardGold.text = gold.ToString();
boardSkillChip.text = skillChip.ToString();
}

public void loadAccountInfo(SpriteRenderer icon, string lName, string titlee, bool winOrLose, bool isFirstTime) {
if (isFirstTime)
{
firstTimeText.text += BattleManager.instance.selectedLevel.aw.temperStar;
}
isWin = winOrLose;
playerIcon.overrideSprite = Resources.Load<UnityEngine.Sprite>("Weapon/" + Player.instance.weapon + "/PlayerIcon/plrIcon");
levelName.text = lName;
title.text = titlee;

expBar.value = (float)Player.instance.nowEXP / (float)Player.instance.requiredEXP[Player.instance.level - 1];
lvText.text = "Lv." + Player.instance.level;
goldText.text = "x" + gold;
skillChipText.text = "x" + skillChip;

if (isWin)
exp += BattleManager.instance.selectedLevel.aw.exp;
if (exp + Player.instance.nowEXP >= Player.instance.requiredEXP[Player.instance.level - 1])
{
levelUp(exp - Player.instance.requiredEXP[Player.instance.level - 1], Player.instance.level);
}
else
{
Player.instance.nowEXP += exp;
StartCoroutine(expBarAnim(false, 0, Player.instance.nowEXP, Player.instance.level));
}
Player.instance.gold += gold;
Player.instance.skillChip += skillChip;
}

public void levelUp(int expp, int nowLV) {
Player.instance.level++;
if (expp >= Player.instance.requiredEXP[Player.instance.level - 1])
{
//lvText.text = "Lv." + Player.instance.level;
levelUp(expp - Player.instance.requiredEXP[Player.instance.level - 1], nowLV);
}
else
{
StartCoroutine(expBarAnim(true, (Player.instance.level - nowLV), expp, nowLV));
Player.instance.nowEXP = expp;
}
}

public IEnumerator expBarAnim(bool isLevelUp, int upLevel, int targetExp, int nowLV) {

int l = upLevel;
float nowExp = Player.instance.nowEXP;
int lv = nowLV;
yield return new WaitForSeconds(1);
while (l != 0 || nowExp < targetExp)
{
yield return null;
nowExp += 500 * Time.deltaTime;
expBar.value = nowExp / (float)Player.instance.requiredEXP[lv - 1];
if (nowExp >= Player.instance.requiredEXP[lv - 1])
{
lv++;
nowExp -= Player.instance.requiredEXP[lv - 1];
l--;
lvText.text = "Lv." + lv;
}
}
}
}
12 changes: 12 additions & 0 deletions Assets/AccountInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions Assets/Animation/DamageText.controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: DamageText
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107203341258342608}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &1102012681969971046
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: DamageTextAnim
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_Motion: {fileID: 7400000, guid: 33625d81cf7d35b4cb6d75130775263c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
--- !u!1107 &1107203341258342608
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102012681969971046}
m_Position: {x: 235, y: 65, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102012681969971046}
8 changes: 8 additions & 0 deletions Assets/Animation/DamageText.controller.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c914263

Please sign in to comment.