Images (click to expand):
Spoiler:
Gamebanana: http://gamebanana.com/skins/146422
http://gamebanana.com/skins/download/146422
private bool isDead = true;
bool IsDead {
set { isDead = value; }
get { return isDead; }
}
AudioParam param;
param.pitch += (GetRandom()-GetRandom())*0.1f;
it's private, so it doesn't need "get{} set{}"No. It needs its own getter and setter because it's private. Think about it: What's the point of making a getter and setter for a public member when you can just reference the member itself?
... In the RifleMagazineParticle class
// declares a boolean private member "isDead" and is initialized to true whenever an instance of this class is made
// I can't reference isDead in some code outside of this class because its private
private bool isDead = true;
// however, by declaring a getter and setter (notice that the "I" in "IsDead" is capitalized)
// I can freely define *how* I want this member to be accessed.
bool IsDead {
set { isDead = value; }
get { return isDead; }
}
... in some other source file
RifleMagazineParticle mag(...);
mag.isDead = false; // won't work, I am accessing a private member.
mag.IsDead = false; // will work and will set isDead to false.
class MyObj
{
// A virtual property with accessors
int prop
{
get const
{
// The actual value of the property could be stored
// somewhere else, or even computed at access time.
return realProp;
}
set
{
// The new value is stored in a hidden parameter appropriately called 'value'.
realProp = value;
}
}
// The actual value can be stored in a member or elsewhere.
// It is actually possible to use the same name for the real property, if so is desired.
private int realProp;
}
Also you could do so much better if you implemented dropped magazine feature in the source code itself. Wanna try? I can help (a little tiny bit).I could, but that would mean competing with your version :)
Users browsing this forum: No registered users and 51 guests