unity custom update
float StartingRate = 0.5f;
float UpdateRate = 0.3f;
void Start(){
InvokeRepeating("CustomUpdate",StartRate, UpdateRate);
//This will start in 0.5s and start repeating in 0.3f
}
void CustomUpdate(){
//Your code here
}
unity custom update
float StartingRate = 0.5f;
float UpdateRate = 0.3f;
void Start(){
InvokeRepeating("CustomUpdate",StartRate, UpdateRate);
//This will start in 0.5s and start repeating in 0.3f
}
void CustomUpdate(){
//Your code here
}
unity custom update
using UnityEngine;
using System.Collections;
public class DamageSource : MonoBehaviour {
protected float damageAmount = 10f;
//not 100% necessary, but handy for an example of how to
//handle damage based on the attacker (which is
//relevant for info sent in the OnTakeDamage() method
protected ElementType elementType = ElementType.Normal;
//we use a function for getting the damage this
//DamageSource can do because it lets us overwrite it.
//Eg, if the enemy is weakened, you can factor that
//in and return a lesser amount of damage.
public float GetDamageAmount() {
return damageAmount;
}
public ElementType GetElementType() {
return elementType;
}
}
//kinds of elements available for damage / resistance calculations
public enum ElementType {
Normal,
Fire,
Ice,
Lightning
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us