Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - SirChick

Pages: [1]
So i am trying to figure out how i can pass parameters to my method which then creates a tween from it.

I am unsure how people are doing it - and have not really seen many in depth examples for this. My current method is like this:

Code: [Select]
public void SetTarget(Hashtable ht){
    if(ht.ContainsKey("duration") == false){
    if(ht.ContainsKey("ease") == false){

    DOTween.To(()=> transform.position, x=> transform.position = x, (Vector3)ht["target"], (float)ht["duration"]).SetEase((Ease)ht["ease"]);

I assume a hash table is not the smartest way to approach this, and i can see  this is going to get even more unmanageable when i add callbacks of which also have parameters. I am confused how for example i would pass an ease type say Quad ease in-out or callbacks with parameters to go with them.

I call my method like this:

Code: [Select]
void eventTriggered(){
    Hashtable param = new Hashtable();

Has any one got any advice on how i should setup my method to be more flexible like this?

Pages: [1]