private void GenerateBuffer()
 {
     _CustomizationBuffer.Clear();
     _CustomizationBuffer.AddRange(ModelCustom.GetAllSettings());
     _CustomizationBuffer.AddRange(AbilityCustom.GetAllSettings());
     _CustomizationBuffer.AddRange(ProjectileCustom.GetAllSettings());
     _CustomizationBuffer.AddRange(TentacleCustom.GetAllSettings());
     _CustomizationBuffer.AddRange(DetectionCustom.GetAllSettings());
     foreach (var custom in _CustomizationBuffer)
     {
         custom.Initialize();
         custom.LogDev("Init!");
         custom.LogVerbose(custom.Target.ToDebugString());
     }
 }
Exemplo n.º 2
0
    public void CreateProjectile(int objectCode, Action2 action, Vector2 offsetFromBC)
    {
        if (ToLeft)
        {
            float xMin = -Rect.width / 2f;
            xMin += 0.1f;
            offsetFromBC.x = Mathf.Max(offsetFromBC.x, xMin);
        }
        else
        {
            float xMax = Rect.width / 2f;
            xMax -= 0.1f;
            offsetFromBC.x = Mathf.Min(offsetFromBC.x, xMax);
        }

        Rect parentRect = Rect.ObjectRectInLayer;
        Vector2 parentBC = new Vector2(parentRect.x, parentRect.y - parentRect.height / 2);
        Vector2 startPos = parentBC + offsetFromBC;
        FieldObjectEntity objectField = TableLoader.GetTable<FieldObjectEntity>().Get(objectCode);
        ProjectileEntity objectProjectile = TableLoader.GetTable<ProjectileEntity>().Get(objectCode);
        Projectile instance = new ProjectileCustom(this, startPos.x, startPos.y, objectField, objectProjectile, action);

        CreateChild(instance, startPos.x, startPos.y);
    }