git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1295 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -23,31 +23,31 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
||||||
frame = 0;
|
frame = 0;
|
||||||
//tickFunc = delegate
|
tickFunc = delegate
|
||||||
//{
|
{
|
||||||
// ++frame;
|
++frame;
|
||||||
// if( frame >= currentSequence.Length )
|
if( frame >= currentSequence.Length )
|
||||||
// {
|
{
|
||||||
// frame = currentSequence.Length - 1;
|
frame = currentSequence.Length - 1;
|
||||||
// tickFunc = delegate { };
|
tickFunc = delegate { };
|
||||||
// }
|
}
|
||||||
//};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayRepeating( string sequenceName )
|
public void PlayRepeating( string sequenceName )
|
||||||
{
|
{
|
||||||
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
currentSequence = SequenceProvider.GetSequence( name, sequenceName );
|
||||||
frame = 0;
|
frame = 0;
|
||||||
//tickFunc = delegate
|
tickFunc = delegate
|
||||||
//{
|
{
|
||||||
// frame = ( frame + 1 ) % currentSequence.Length;
|
frame = ( frame + 1 ) % currentSequence.Length;
|
||||||
//};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Action<double> tickFunc;
|
Action<double> tickFunc;
|
||||||
public void Tick( double t )
|
public void Tick( double t )
|
||||||
{
|
{
|
||||||
//tickFunc( t );
|
tickFunc( t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,32 +7,23 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
class ConstructionYard : Actor
|
class ConstructionYard : Actor
|
||||||
{
|
{
|
||||||
const string name = "fact";
|
Animation animation = new Animation( "fact" );
|
||||||
|
|
||||||
static Sequence idle = SequenceProvider.GetSequence(name, "idle");
|
|
||||||
static Sequence make = SequenceProvider.GetSequence(name, "make");
|
|
||||||
|
|
||||||
Sequence current = make;
|
|
||||||
int frame = -1;
|
|
||||||
|
|
||||||
public ConstructionYard(float2 location, int palette)
|
public ConstructionYard(float2 location, int palette)
|
||||||
{
|
{
|
||||||
this.renderLocation = location;
|
this.renderLocation = location;
|
||||||
this.palette = palette;
|
this.palette = palette;
|
||||||
|
animation.PlayToEnd( "make" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Sprite[] CurrentImages
|
public override Sprite[] CurrentImages
|
||||||
{
|
{
|
||||||
get
|
get { return animation.Images; }
|
||||||
{
|
|
||||||
if ((current == make) && ++frame >= current.Length)
|
|
||||||
{
|
|
||||||
frame = 0;
|
|
||||||
current = idle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Sprite[] { current.GetSprite(frame) };
|
public override void Tick( World world, double t )
|
||||||
}
|
{
|
||||||
|
animation.Tick( t );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,18 +9,18 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
class Refinery : Actor
|
class Refinery : Actor
|
||||||
{
|
{
|
||||||
const string name = "proc";
|
Animation a = new Animation( "proc" );
|
||||||
static Sequence idle = SequenceProvider.GetSequence(name, "idle");
|
|
||||||
|
|
||||||
public Refinery(float2 location, int palette)
|
public Refinery(float2 location, int palette)
|
||||||
{
|
{
|
||||||
|
a.PlayToEnd( "idle" );
|
||||||
this.renderLocation = location;
|
this.renderLocation = location;
|
||||||
this.palette = palette;
|
this.palette = palette;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Sprite[] CurrentImages
|
public override Sprite[] CurrentImages
|
||||||
{
|
{
|
||||||
get { return new Sprite[] { idle.GetSprite(0) }; }
|
get { return a.Images; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user