using System;
using System.Collections.Generic;
using UnityEngine;
namespace coa4u
{
///
/// Instantly moves the target to the given point.
///
class ActionSetPlace : ActionInstant
{
protected Vector3 value;
public ActionSetPlace(Vector3 tgtPlace)
: base()
{
value = tgtPlace;
}
public ActionSetPlace(Vector2 tgtPlace)
: this((Vector3)tgtPlace)
{
is2d = true;
}
///
/// Returns a copy of the action.
///
public override ActionInstant clone()
{
return new ActionSetPlace(value);
}
///
/// This method is called at the action start.
///
public override void start()
{
base.start();
if (is2d)
value.z = transform.position.z;
transform.position = value;
}
}
}