Example #1
0
 void OnAssetUpdated(Spaces.Core.Asset _asset, Spaces.Core.Asset.Process[] last, Spaces.Core.Asset.Process next)
 {
     if (asset == _asset && last.Length > 0)
     {
         Debug.Log(asset.name + " [Switched State] " + last.ToString() + " => " + next.ToString());
     }
 }
Example #2
0
        private void AssetUpdated(Spaces.Core.Asset asset, Spaces.Core.Asset.Process[] lastState, Spaces.Core.Asset.Process newState)
        {
            //if (currentAsset != asset)
            //    currentAsset = asset;

            //if (lastState == Core.Asset.State.Creating && newState != Core.Asset.State.Error)
            //{
            //    asset.AddData(this.PathToBundle);
            //}

            //if (newState == Core.Asset.State.RequestingEndpoint)
            //    UpdateState(State.GettingUploadPath);
            //else if (newState == Core.Asset.State.Uploading)
            //    UpdateState(State.Uploading);
            //else if (lastState == Core.Asset.State.Uploading && newState == Core.Asset.State.Idle)
            //    UpdateState(State.Complete);
            //else if (newState == Core.Asset.State.Error)
            //    UpdateState(State.Error);
        }
Example #3
0
    //public static void CalculateLocalBounds(GameObject go)
    //{
    //    Quaternion currentRotation = go.transform.rotation;
    //    go.transform.rotation = Quaternion.Euler(0f, 0f, 0f);

    //    Bounds bounds = new Bounds(go.transform.position, Vector3.zero);

    //    foreach (Renderer renderer in go.GetComponentsInChildren<Renderer>())
    //    {
    //        bounds.Encapsulate(renderer.bounds);
    //    }

    //    Vector3 localCenter = bounds.center - go.transform.position;
    //    bounds.center = localCenter;

    //    //Debug.Log("Bounds center: " + bounds.center + " | Bounds size: " + bounds.size);

    //    go.transform.rotation = currentRotation;
    //}

    void StateChangeHandler(Spaces.Core.Asset asset, Spaces.Core.Asset.Process[] currentStates, Spaces.Core.Asset.Process state)
    {
        Debug.Log("[Frame " + frame + "] " + asset.name + " (" + asset.id + ") [EVENT!!! " + state.ToString() + "] " + string.Join("|", currentStates.Select(s => s.ToString()).ToArray()));
    }