Added project
This commit is contained in:
14
Platformer/Assets/Scripts/For HW05/Bus.cs
Normal file
14
Platformer/Assets/Scripts/For HW05/Bus.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Bus: Vehicle {
|
||||
|
||||
public Bus() {
|
||||
vehicleName = "Bus";
|
||||
}
|
||||
|
||||
public override void Beep() {
|
||||
base.Beep();
|
||||
Debug.Log($"{vehicleName}: beeeep");
|
||||
}
|
||||
|
||||
}
|
||||
11
Platformer/Assets/Scripts/For HW05/Bus.cs.meta
Normal file
11
Platformer/Assets/Scripts/For HW05/Bus.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 328e8ea01a57b39b0a073a8d8c46cf77
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Platformer/Assets/Scripts/For HW05/Car.cs
Normal file
13
Platformer/Assets/Scripts/For HW05/Car.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Car: Vehicle {
|
||||
|
||||
public Car() {
|
||||
vehicleName = "Car";
|
||||
}
|
||||
|
||||
public override void Beep() {
|
||||
base.Beep();
|
||||
Debug.Log($"{vehicleName}: beep");
|
||||
}
|
||||
}
|
||||
11
Platformer/Assets/Scripts/For HW05/Car.cs.meta
Normal file
11
Platformer/Assets/Scripts/For HW05/Car.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf33bec4a92af3ed6ba28c2390dc9dc5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
29
Platformer/Assets/Scripts/For HW05/Cat.cs
Normal file
29
Platformer/Assets/Scripts/For HW05/Cat.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Cat {
|
||||
|
||||
public string name { get; }
|
||||
public int age { get; }
|
||||
public int weight { get; set; }
|
||||
public int height { get; }
|
||||
public int length { get; }
|
||||
|
||||
public Cat() {
|
||||
}
|
||||
|
||||
public Cat(string name, int age, int weight, int height, int length) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
this.weight = weight;
|
||||
this.height = height;
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public void meov() {
|
||||
Debug.Log(this);
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return $"Cat: \"name\": \"{name}\", \"age\": {age}, \"weight\": {weight}, \"height\": {height}, \"length\": {length}'";
|
||||
}
|
||||
}
|
||||
11
Platformer/Assets/Scripts/For HW05/Cat.cs.meta
Normal file
11
Platformer/Assets/Scripts/For HW05/Cat.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5f59cbe9eb9251d4a3d99b065afcb9a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14
Platformer/Assets/Scripts/For HW05/Tractor.cs
Normal file
14
Platformer/Assets/Scripts/For HW05/Tractor.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Tractor: Vehicle {
|
||||
|
||||
public Tractor() {
|
||||
vehicleName = "Tractor";
|
||||
}
|
||||
|
||||
public override void Beep() {
|
||||
base.Beep();
|
||||
Debug.Log($"{vehicleName}: trrr");
|
||||
}
|
||||
|
||||
}
|
||||
11
Platformer/Assets/Scripts/For HW05/Tractor.cs.meta
Normal file
11
Platformer/Assets/Scripts/For HW05/Tractor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 557a1b08d5299f343aa7c9571b2d79cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11
Platformer/Assets/Scripts/For HW05/Vehicle.cs
Normal file
11
Platformer/Assets/Scripts/For HW05/Vehicle.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
abstract public class Vehicle {
|
||||
|
||||
public string vehicleName { get; set; }
|
||||
|
||||
public virtual void Beep() {
|
||||
Debug.Log("Vehicle");
|
||||
}
|
||||
|
||||
}
|
||||
11
Platformer/Assets/Scripts/For HW05/Vehicle.cs.meta
Normal file
11
Platformer/Assets/Scripts/For HW05/Vehicle.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a356526260da9e9cbea681e569cd364
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user