示例#1
0
 void Awake()
 {
     affector       = GetComponent <Affector2D>();
     startPosition  = affector.position;
     randomPosition = GetRandomPosition();
     _health        = health;
 }
示例#2
0
 void Awake()
 {
     instance      = this;
     affector      = GetComponent <Affector2D>();
     startPosition = affector.position;
     _health       = health;
 }
示例#3
0
    public static void Spawn(Affector2D sourceAffector, Vector2 position, Projectile projectile, Transform parent, Vector2 targetPosition)
    {
        var projectileInstance = Instantiate(projectile, parent);
        var a = projectileInstance.transform.position;
        var b = position;

        a.x = b.x;
        a.y = b.y;
        projectileInstance.transform.position = a;
        projectileInstance.transform.parent   = null;
        projectileInstance.owner     = sourceAffector;
        projectileInstance.direction = Utils.GetDirection2D(position, targetPosition);
    }